Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2003
    Location
    Mass
    Posts
    22

    Downloading a pdf using "save as"

    I am trying to give the user the option to save a pdf from the cd to a location of their choosing. I know the user can save the pdf itself but my client wants a button on the interface. tried a few things in the Dialogue and File actions but without any success. Any help would be appreciated. Thanks, Bob

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    Here, Try this

    just edit the path to your pdf file

    Code:
    SaveAs = Dialog.FileBrowse(true, "Save File As", _DesktopFolder, "All Files (*.*)|*.*|", "", "pdf", false, false);
    if SaveAs[1] ~= "" and SaveAs[1] ~= "CANCEL" then
    File.Copy("AutoPlay\\Docs\\yourfile.pdf", SaveAs[1], true, true, false, true, nil);
    
    	error = Application.GetLastError();
    	if (error ~= 0) then
    	    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    	end
    end
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    May 2003
    Location
    Mass
    Posts
    22
    Great! Thanks! Now I'm wondering if when the dialogue box opens it already has the name of the file in the drop down. Again many thanks, Bob

  4. #4
    Join Date
    May 2006
    Posts
    5,380
    ok, you can put a default filename in the code,

    change this line

    SaveAs = Dialog.FileBrowse(true, "Save File As", _DesktopFolder, "All Files (*.*)|*.*|", "", "pdf", false, false);
    to something like this

    SaveAs = Dialog.FileBrowse(true, "Save File As", _DesktopFolder, "All Files (*.*)|*.*|", "myfile", "pdf", false, false);


    EDIT:

    also i just noticed that the button says "open" and not "save"

    change the frist "true" to "false" and it will dispaly "save"
    SaveAs = Dialog.FileBrowse(false, "Save File As", _DesktopFolder, "All Files (*.*)|*.*|", "myfile", "pdf", false, false);
    Last edited by RizlaUK; 03-22-2007 at 04:01 PM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  5. #5
    Join Date
    May 2003
    Location
    Mass
    Posts
    22
    You just made me look briliant! Thanks for everything. Bob

  6. #6
    Join Date
    May 2006
    Posts
    5,380
    hey no problem Bob, glad to help
    Open your eyes to Narcissism, Don't let her destroy your life!!

Similar Threads

  1. PDFout by Worm
    By azmanar in forum AutoPlay Media Studio 6.0
    Replies: 11
    Last Post: 09-22-2006, 12:29 PM
  2. PDF in a web object and web.loadULR
    By cizzz in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 03-26-2004, 09:25 AM
  3. Opening an Adobe Acrobat PDF Document
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-26-2003, 01:30 PM
  4. opening a pdf file to a specific page
    By Jaegergirl in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 06-17-2003, 10:52 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