How do I compress PDF files using Acrobat SDK?

have a web service created in a .net environment that examines existing pdf files in a staging directory prior to sending them over the wire using FTP.
Part of that process requires that I rename individual files in order to associate them with a particular batch.
I also have a requirement to reduce the size of individual files as much as possible in order to reduce the traffic going over the line.
So far I have managed about a 30% compression rate by using an open source library (iTextSharp).
I  am hoping that I can get a better compression rate using the Acrobat SDK, but I need someone to show me how, hopefully with an example that I can follow.
The following code snippet is a model I wrote that accomplishes the rename and file compression...
            const string filePrefix = "19512-";
            string[] fileArray = Directory.GetFiles(@"c:\temp");
            foreach (var pdffile in fileArray) {
                string[] filePath = pdffile.Split('\\');
                var newFile = filePath[0] + '\\' + filePath[1] + '\\' + filePrefix + filePath[2];               
                var reader = new PdfReader(pdffile);
                var stamper = new PdfStamper(reader, new FileStream(newFile, FileMode.Create), PdfWriter.VERSION_1_5);
                int pageNum = 1;
                for (int i = 1; i <= pageNum; i++) {
                    reader.SetPageContent(i, reader.GetPageContent(i), PdfStream.BEST_COMPRESSION);
                stamper.Writer.CompressionLevel = PdfStream.BEST_COMPRESSION;
                stamper.FormFlattening = true;
                stamper.SetFullCompression();
                stamper.Close();
Any assistance is appreciated.

You can't use Adobe Acrobat on a server.

Similar Messages

  • Print PDF file using Acrobat SDK - Warning message

    Hello,
    We are trying to create automatic program in c# that will print all pdf files located in a specific folder, using Adobe Acrobat 9.0 SDK.
    Whenever the application tries to print file, we receive a warning message ("WARNING! A script has requested to print an Acrobat file. This could print an entire document. Do you want to proceed printing?").
    If we press yes, the file is printed, but next time we'll run the application, this message will appear again.
    Since this application supposed to run automatically (with no interaction with the end users), we want to prevent this warning message from appearing.
    How can we eliminate this warning message?
    Is there any other way to print PDF files using Adobe Acrobat from another application?
    Thanks,
    Lilach.

    joeln3:  I believe the original post refers to a client application, not a web page.  Why use JavaScript from within a client application?  I understood their use case to involve a client app referencing the PDF Library, loading various PDF files, and using one (or more) of the PDF Library's Print methods to invoke Acrobat's internal print routines.
    Dave

  • How to open a pdf file using Acrobat reader in Java?

    Or if you can just tell me where in the tutorial is the section that discuss running other application from Java, I'd appreciate it. My assignment(at work, not school) is to make a class that receive a pdf file, which is passed by RMI, and display it in a child window or in a JDesktopPane. Thank you.
    kindo

    Hi Kindoo,
    try using Runtime.exe(fileName)
    Nagaraj

  • How to check the resolution of a pdf file using Acrobat 9 pro?

    How to check the resolution of a pdf file using Acrobat 9 pro?

    PDF files don't have one resolution, but may have none or many different resolutions, one per image. You can check the maximum/minimum resoluion with preflight in Acrobat Pro, but not in Adobe Reader.

  • How do I edit a PDF file using Acrobat 9 - Version 9.4.0

    My company - [name deleted by host] purchased Acrobat 9 - Version 9.4.0. for me
    How do I edit a PDF file using Acrobat 9 - Version 9.4.0
    I need to edit - copy, extract text, add text, etc. from existing PDF files to SAVE my changes,
    or create a new PDF file from an existing file.
    This is very important for me to be able to do my job effectively.
    I spent over 2 hrs the last few days, and another hour today, still can't do it.
    PLEASE respond ASAP with a solution.
    Thanks in advance,
    - Daulton West
    [signature deleted by host]

    PDF is an end destination format - although Acrobat is capable of making minor changes to a file (e.g. to correct typos) it is not a word processor or DTP application. Major changes must be done in the original document, and the PDF file re-exported.
    You can copy text from a file by selecting it and right-clicking, or you can save the file as plain or formatted text. To make small changes to the text on a page, use the touchup tool - see the help file for more info.

  • How to protect my PDF file using Adobe Acrobat Pro that i can trace user's IP adress?

    How to protect my PDF file using Adobe Acrobat Pro that i can trace user's IP adress?

    Used to be able. Considered a security bug. Fixed.

  • Can't view PDF files using Acrobat Reader X

    We made many PDF files available on our Web site. In the past few weeks we noticed that users who were using Acrobat Reader X and Internet Explorer 8 or 9 were not able to view some PDF files. Basically, when they clicked a link to display a PDF file, the screen would be cleared and the status bar showing "Loading ...KB/...K/B" would be displayed. The status bar would move a bit and then got stuck. The PDF file would never be displayed. Sometimes, my users could click the Back button to go back the previous Web page and sometimes they had to close or kill the IE window. Small PDF files seemed to be fine. I was able to repeat this problem on PCs running Windows XP and Windows 7. I also tested clicking the same PDF files with PCs installed with Acrobat Reader 9 and I was not able to cause the problem to occur, so I am pretty sure that this problem is related to Acrobat Reader X. I also noticed that if I unchecked the "Display PDF in browser"  option in Acrobat Reader X so that PDF files would not be displayed inside the Internet Explorer window, I would be able to view all PDF files without any problems.
    I also did an experiment by resaving many PDF files using Acrobat Pro (Reduce File Size...) to be compatible with Acrobat 8 or above. I was able to open these PDF files using Acrobat Reader X but when I used a PC with Acrobat 9, it would get stuck instead. Most of my PDF files were created a long time ago and we usually made it compatible with Acrobat 5 or above.
    I saw that some people reported some problems with Acrobat Reader X but I did not see a solution except uninstalling Acrobat Reader X and installing an old version of Acrobat Reader instead. Anyone has any ideas why this is happening and how to fix this problem?
    RJ

    Sounds like you got the trial of Acrobat. Go to add/remove programs, get rid of it, the download the free Reader from http://get.adobe.com/reader/

  • Does anyone know how i can view PDF files using Galaxy Note 2?

    Does anyone know how i can view PDF files using Galaxy Note 2?
    This is what i have been doing;
    I click on the file i wish to view (via a portal)
    this file goes to notification widget (i drag down screen)
    notification/message says download complete
    i click on notification/message
    nows it says complete action using (here i only have 2 icon options 1= DB Text Editor 2 = HTML Viewer)
    I have installed Adobe Reader.

    Can you confirm if the downloaded file is a pdf file, that is it ends with .pdf?

  • Problem reopening and/or refreshing PDF files using Acrobat Reader V. 8.0

    I upgraded to Adobe Acrobat Reader V. 8.0 and have encountered problems refreshing PDF files in the Safari 2.0.4 browser when I am logged into the secure area for Value Line Publishing. Some of the PDF Files in this area can be opened and/or refreshed multiple times. Other PDF files in this area allow me to open them once. I cannot reopen those previously viewed files (or refresh the screen) -- after refreshing, the window changes to a blank white screen, and the files do not reopen.
    I am perplexed because I do not have difficulty refreshing the PDF files (within Safari) using the native PDF viewer, I did not have problems refreshing files using Acrobat Reader V. 7.0 and I do not appear to have problems refreshing PDF files using Acrobat Reader V. 8.0 when I am outside the secure area or on other web sites.
    I have replaced the Acrobat Reader plug-in, manually removed all remnants of previous versions of Acrobat Reader and reinstalled V. 8.0. and I also upgraded from Mac OS 10.4.8 to 10.4 9, all to no avail.
    I can clear the Safari cache files as a temporary solution, but I encounter the same difficulties with the “problematic” files once they have been opened again.
    I can also download the PDF files to my hard drive and refresh them multiple times within Safari and also using Acrobat Reader V. 8.0
    The software personnel at Value Line Publishing have investigated their system and have referred me back to Apple. Has anyone heard of similar problems associated with Adobe Acrobat Reader V. 8.0 used in conjunction with Safari 2.0.4?
    PowerBook G4   Mac OS X (10.3.9)  

    Hi Rodney
    Welcome to Apple Discussions
    This sounds like one of those "oddities", contributed to by a few sources.
    I can clear the Safari cache files as a temporary solution, but I encounter the same difficulties with the “problematic” files once they have been opened again.
    Wondering if you disabled the Safari Cache would the refresh function work correctly? As a test you can disable the Safari Cache by Emptying the Cache first via the Safari menu, then Quit Safari. Now go to the Finder>Your User Library>Caches>Safari. Single click on the Safari folder, then Apple Key + I to open Info panel. There, check the "locked" box. This prevents further additions to the cache. The downside, you lose your ability to upload images etc. within Safari (my cache is disabled, so I use Firefox for the uploads).
    Then restart Safari. Try the PDF from within Safari.
    Post back

  • How to open a pdf file using OPEN DATASET

    Im trying to convert a pdf into binary format. So im trying to read the contents of the pdf into a XSTRING. Using the FM 'SCMS_XSTRING_TO_BINARY' i can convert the XSTRING to binary format.
    How to open a pdf file using OPEN DATASET and transfer its contents in a XSTRING variable.
    What i've tried is....
    DATA: f_name type string value 'C:\rep_output_pdf.pdf',
          x1 type xstring,
          LT_DATA TYPE STANDARD TABLE OF X255.
    OPEN DATASET f_name FOR input IN BINARY MODE.
    READ DATASET f_name INTO x1.
    CLOSE DATASET f_name.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER     = x1
        TABLES
          BINARY_TAB = LT_DATA.
    Im getting a short dump .
    Short text: The file is not open.
    Plz help me out.

    Hello Rajesh,
    You are trying to do use OPEN DATASET with a local file. NOT POSSIBLE
    You have to have the file in the app server to use OPEN DATASET.
    BR,
    Suhas

  • How do I download PDF files using Safari.  All I get is a black screen.

    How do I download PDF files using Safari.  All I get is a black screen.

    Back up all data.
    Quit Safari. In the Finder, select Go ▹ Go to Folder... from the menu bar, or press the key combination shift-command-G. Copy the line of text below into the box that opens, and press return:
    /Library/Internet Plug-ins
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then launch Safari and test.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • Printing web page to pdf file using Acrobat Standard 9

    When I print a web page to a pdf file, the text in the file is mostly garbled.  I have no problems in creating pdf files from MS office or other software.  I have Windows 7 Home.
    Any help will be appreciated.
    Thanks

    I do have Internet Explorer 9 and I was able to print web pages correctly following  your suggestions.
    Thanks for your help.
    Date: Sat, 12 Nov 2011 06:53:59 -0700
    From: [email protected]
    To: [email protected]
    Subject: Printing web page to pdf file using Acrobat Standard 9
        Re: Printing web page to pdf file using Acrobat Standard 9
        created by Bill@VT in Acrobat Windows - View the full discussion
    There were problems with IE9 on it's initial release and that may be what you are seeing if that is the browser (you did not indicate the browser and that may be a key). If you have a different browser you might try that one with the same pages to see if it browser related.
    By saying garbled it sounds like the fonts did not make it or you have selected "Use Local Fonts" in Acrobat. Try checking the latter first. Then check if the fonts are embedded in the PDF by checking the document properties (ctrl-D). If they are not, go back to the browser and select the press or print job options before printing and see if they get embedded and if your problem is resolved.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4021509#4021509
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4021509#4021509. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Acrobat Windows by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Open multiple pdf files using Acrobat Reader?

    Can we open and switch between multiple pdf files using Acrobat Reader?

    Of course, but if it's Reader X or later each file will appear in its own window. This can't be changed.

  • I am unable to read pdf files using Acrobat Reader on my MAC OS X. Any suggestions?

    How do I read pdf files using my MAC OS X?

    You can read pdf files with preview. Select a pdf document, right click on it, and choose Preview. You can also get info and select to choose Preview for all.
    You can also install Adobe Reader 10.1.3 for Lion. It will also install a plug-in to read pdf docs in the browser.
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5360

  • How to Automate Compressing PDF files in a Watched Directory

    I want to automatically compress PDF files as they get placed into a watched directory. I would like the compressed files placed in another directory and have the original file either deleted or place in another directory. If Acrobat Pro X can do this, how do I set it up.

    I noticed that Acrobat Distiller will watch an input directory and move files to an output directory. I tried using Distiller to compress a PDF file, but all it did was move the PDF file to the out directory without doing any compression. Is there any way that Distiller could be configured to do what I want?
    I also called the number listed on the Adobe web site for LiveCycle products. They told me they don't sell their product to non government companies and they referred me to 4 Point to get further info. I called them and only got a voice mail. I'm waiting for a call back.
    I found a product that does exactly what I need. It is called PdfCompressor Professional Edition. But, it costs more than what I want to spend. I'm guessing that LiveCycle will cost more than I want to spend also. If there are any other products that cost less than $150, I would like to know what they are.

Maybe you are looking for

  • HOW CAN I  USE MULTIPLE INNERJOINS IN A SINGLE SELECT STATEMENT?

    HI, I AM SHABEER AHMED, I AM GETTING AN ERROR WHILE I ATTEMPT TO EXECUTE A SELECT STATEMENT WITH MULTIPLE INNER JOINS . BECOZ I WANT TO FETCH ITEM DATA, PARTNER DATA  BASED ON HEADER DATA . THEN OF COURSE I HAVE FETCH DATA FROM VBAK VBAP VBKD SO LZ S

  • Connectivity from Oracle8i (8.1.6) to Oracle7 (7.1.6)

    Hi all, I am going to connect from Oracle8i release 2 running on Unixware 7.1.1 to Oracle7.1.6 running on Sco Openserver. I am getting end_of_communication_channel (03113). From 7.1.6 to 8.1.6 there is no problem. Should I set anything special? Pleas

  • How to remove leading zeros from the screen?

    Hello friends, I am working on dialog programming. I have a field with is NUMC 13. so when value is populated, It removes the leading zeros. How can I display the my value with leading zeros on the screen painter?

  • [SOLVED]catalyst-utils and mesa-libgl are in conflict

    I have this weird issue with pacman, I cant find mesa-libgl (so I cant remove it) and its in conflic with catalyst-utils. the ouput of pacman -Syuu :: Synchronizing package databases... catalyst 9.4 KiB 552K/s 00:00 [#################################

  • About printer model informatio​n

    i'm searching for a printer model for 12000 prints per month. where can i find this information?