Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 15 of 15

Thread: Saving a page

  1. #1
    Join Date
    Sep 2003
    Posts
    78

    Saving a page

    This is an exemple of what i need:

    I want to save page2 by clicking a button in page 1.
    Is this possible with AMS5 pro and how to acheive that?

    Thanks,

    Stephen

  2. #2
    Join Date
    Aug 2003
    Posts
    2,427
    It's way out of my league but it occurs to me having looked at the 'code viewer' in this THIS thread it ought to be possible. If the content of page 2 is e.g. a web object or a text file being loaded into a paragraph then it would be a lot easier.

  3. #3
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Yeah, it really depends on "what" is on Page2.

  4. #4
    Join Date
    Sep 2003
    Posts
    78
    In other words, user must be able to place some texts and cliparts in a "page" and then save it. It is a kind of simple publicity page maker with save capabilities.

    I intend to use this saved page in another AMS app.

    Is this possible? If not, is there any other way to do this?

    Thanks,

    Stephen

  5. #5
    Join Date
    Aug 2003
    Posts
    2,427
    You could certainly get text input on a page and save that out as a file and then retrieve or print it whenever you like. As far as I know, there is no native way to do the same with images.

  6. #6
    Join Date
    Sep 2003
    Posts
    78
    Is it possible to take HTML text (image) and put this code in a web object using a text.File write from string function?

    Thanks,

    Stephen

  7. #7
    Join Date
    Aug 2003
    Posts
    2,427
    Yes you can build html by concatenating the tags with the input text.

    Are you are providing e.g. a set of thumbnails of images on the cd. If so you could then hard code the reference into the on click event of the image and use it in building the html and then save the html and images out to a folder.

  8. #8
    Join Date
    Sep 2003
    Posts
    78
    Thank a lot, i'm not a programmer and may be it will be easier for me to have an exemple. Can you explain your method in details?

    Thanks,

    Stephen

  9. #9
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Stephen,
    One solution would be to use a command line aware utility to capture your window. Irfanview does it well.
    What I would do is put Iview in your Docs dir, launch an event (Page/Button...) which will launch a command line from Ivew (Something like i_view32.exe /capture=1 , which captures the active window), then use the image (clipboard, save or print..).

    Good luck
    Yossi

  10. #10
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    If you interested in what Yosik put forth... here is a DLL file that user Worm put together and shares now via the Examples forum...

    http://www.indigorose.com/forums/showthread.php?t=8797
    Intrigued

  11. #11
    Join Date
    Sep 2003
    Posts
    78
    Yeah thanks, i tried that but i don't want to capture all window. I just need user be able to put an image and/or text in a web browser object and save it for further use; making his own page and save it.

    I told about web browser object but it can be any other way to achieve this app. Any help will be appreciate.

    Thanks,
    Stephen

  12. #12
    Join Date
    May 2003
    Location
    Pendleton, Oregon
    Posts
    1,038
    Fashion,
    What I would suggest doing is to build an example of the web page you are after. This will become your template.

    Next, split the HTML document up into logical parts. (i.e. Head, Body, Foot) and save them as text files.

    When it is time to build a dynamic webpage for your user, you just combine the HTML parts with your user data, to create the finished HTML page.

    Here is an example of how it might go together:

    In your program you get two variables from the user:

    The/path/to/the/picture/file = pic_path

    The user text = user_text

    Now you need to read your text files in as variables.
    head = TextFile.ReadToString("AutoPlay\\Docs\\head.txt");
    body = TextFile.ReadToString("AutoPlay\\Docs\\body.txt");
    foot = TextFile.ReadToString("AutoPlay\\Docs\\foot.txt");

    head.txt might look something like this:
    <html>

    <head>
    <meta **********="Content-Language" content="en-us">
    <meta **********="Content-Type" content="text/html; charset=windows-1252">
    <title>User Page</title>
    </head>

    <body>

    <p align="center">
    <img border="0" src="file:///





    body.txt might look like this:

    " ></p>
    <p align="left">



    foot.txt might look like this:

    </p>

    </body>

    </html>



    Next you’re going to write out the full HTML file
    TextFile.WriteFromString("AutoPlay\\Docs\\user.htm l", head .. pic_path .. body .. user_txt .. foot, false);


    Now you can navigate to the page, or save it, or whatever you want.

    If you plan on moving the page between machines, or onto the Web, then you will need to make the path to the picture a ‘relative path’ instead.

  13. #13
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    I am currently using a couple of functions in a project I am playing with that dynamically creates html pages based from a data file. I have a function that creates and destroys the page and I fill in the body as necessary.

    Code:
    function CreatePage(strTitle)
    	local String1 = ""
    	String1 = String1 ..	'<html>' ..
    				'<head>' ..
    				'<title>'.. strTitle ..'</title>' ..
    				'</head>' ..
    				'<body bgcolor="white" text="black">' ;
    	return String1;
    end
    	
    	
    function DestroyPage()
    	return '</body></html>'
    end
    To use these functions I do this in the project.

    Code:
    strHTML = CreatePage(strName);
    strHTML = strHTML .. '<p><b>'..tblGS.Name..'</b> by '..tblGS.Placed ..'<br>'.."\r\n"..
    		                     'Size: ' .. tblGS.Container ..'<br>'.. "\r\n" ..
    		                     strName ..'<br>'.. "\r\n" ..
    		                     strNS .. " " .. strLat .. " "..strEW .. " " .. strLon ..'<br>'.. "\r\n" ..
    		                     tblGS.State ..'<br>'.. "\r\n" ..
    		                     'Difficulty: ' .. tblGS.Difficulty.. "\/"..'Terrain: ' .. tblGS.Terrain ..'<br>'.. "\r\n"..
    		                     '<br>'.. "\r\n"..
    		                     tblGS.Short ..'<br>'.. "\r\n"..
    		                     '<hr>'..'<br>'.. "\r\n"..
    		                     tblGS.Long ..'<br>'.. "\r\n"..
    		                     '<hr>'..'<br>'.. "\r\n" ..
    		                     '<a href="'..strName..'_hints.htm">Hints</a>'
    strHTML = strHTML .. DestroyPage()
    		
    TextFile.WriteFromString(_TempFolder .. "\\"..strName..".htm", strHTML, false);
    This creates a page per item that was read from a text file. Works great. I cannot claim the code as my own but found it here on the IR forum.

    HTH
    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  14. #14
    Join Date
    Sep 2003
    Posts
    78
    Thanks JimS,

    i'm not sure to understand all your suggestion but i think i will be able to try it out. The problem is i don't have enough HTML knowledge to achieve that but i have good books and helps.

    Thanks a lot,

    Stephen

  15. #15
    Join Date
    Sep 2003
    Posts
    78
    Thanks Tigger too,

    i will try this with some help here cause i'm not sure what to do with function.


    Thanks again,


    Stephen

Similar Threads

  1. Page Transitions by Warmuskerken Consulting
    By Worm in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 09-10-2008, 06:37 AM
  2. Inheriting Page Properties
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-01-2003, 02:21 PM
  3. Setting Page Transition Effects
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-24-2003, 01:08 PM
  4. Nested Page Inheritances, works fine but there's a bug...
    By Corey in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 12-17-2002, 03:16 PM
  5. HOWTO: Create a Page Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-26-2002, 05:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts