Print to PDF and specify a file name

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default Print to PDF and specify a file name

    The following script gives me Out Of Memory error:

    var pp = this.getPrintParams();
    pp.interactive = pp.constants.interactionLevel.silent;
    pp.fileName = "/c/temp/myDoc.pdf";
    pp.printerName = "Adobe PDF";
    this.print(pp);

    How else can I print to a pdf file and specify a file name. this.SaveAs gives me much bigger file.

    Thank you for your help.
    Ally_Sapoger@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Print File
      I seem to be having a problem creating a Print button that prints a .gif file directly (eg. an optimized colouring book page.) The only way I...
    2. When trying to print pdf file get this message
      %%%% %%%% Error accessing color profile: U.S. Web Coated (SWOP) v2 %% %% Any help would be appreciated. What should I do or how can I correct...
    3. File> to print Windows?
      I want to print all files in a folder, I used to be able to do this in earlier versions before OSX as in in File to Print windows, but do not see...
    4. print to file
      Can someone please tell me how I can print or save a current record so as to send as an email attachment for other to view in PDF, DOC, TXT, or XLS...
    5. how print dir list AND print to file?
      hi KB article Q321379 shows me a great way to print the directory listing, but it only goes straight to the printer. to make a useful table of...
  3. #2

    Default Re: Print to PDF and specify a file name

    Why want you print a PDF document to Adobe PDF?
    Bernd Alheit Guest

  4. #3

    Default Re: Print to PDF and specify a file name

    I have a form that takes a lot of space (About 1 mb), if I use thsi.saveAs with flattenPages I can get it down to about 400 KB, if I use Print To PDF I gives me a PDF with a size of 108 KB. he form will be filled out by a number of users.
    Ally_Sapoger@adobeforums.com Guest

  5. #4

    Default Re: Print to PDF and specify a file name

    But if you are flattening the pages, there are no form fields for the user to fill out>?!?

    Also, printing to PDF is a LOSSY operation - don't do it.
    Leonard_Rosenthol@adobeforums.com Guest

  6. #5

    Default Re: Print to PDF and specify a file name

    I guess, I wasn't clear, pages are flattened after the user fills out the form. I just need to reduce the size of the resulting pdf as much as possible. I got the smallest size by printing the filled out form to a pdf file. Leonard, if you could tell me:

    1. What is the best method of reducing the size of the filled out form?
    2. Why the script that I posted doesn't work?

    Thank you.
    Ally_Sapoger@adobeforums.com Guest

  7. #6

    Default Re: Print to PDF and specify a file name

    The script you posted doesn't work because what you are trying to do is not supported.

    But if you flatten the form, you can't get the data back in the future. It's no longer a form :(. I would recommend that you simply use the PDF Optimizer feature in Acrobat to let it reduce the size. It will give you an excellent reduction while keeping the form useful in the future.
    Leonard_Rosenthol@adobeforums.com Guest

  8. #7

    Default Re: Print to PDF and specify a file name

    The following script is from Adobe Acrobat JavaScript Scripting Reference, page 300:
    var pp = this.getPrintParams();
    pp.fileName = "/c/temp/myDoc.ps";
    pp.printerName = "";
    this.print(pp);

    It gives me the same Out Of Memory error. Is this not supported either?

    After the user filled out the form, I need to save the filled out form as a pdf file (not a form).
    Filled out form has a size of 1.2 MB. After using PDF optimizer, its' size becomes 960 KB, after flattenPages its' size becomes 610 KB. If I print it to PDF, its' size becomes 230 KB. Since I have to store a rather large number of filled out forms (just filled out pdfs for archiving purposes), you can see why I am really interested in using the Print to PDF feature.
    Ally_Sapoger@adobeforums.com Guest

  9. #8

    Default Re: Print to PDF and specify a file name

    If you are saving these for archiving purposes, have you looked at the PDF/A standard (PDF for long term archival) as a solution? See <http://www.pdfa.org> for more info.

    If you want to flatten, you can use Optimizer to do that as well. it has a "Flatten form fields" option on the "Discard Objects" page.

    One reason that Print to PDF gets it smaller is that it is throwing away important information (such as embedded font data) that is important for the archival process.
    Leonard_Rosenthol@adobeforums.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139