Compress pdf-files by using method cl_abap_gzip= compress_binary

Hello,
I tried to create a zip file from a pdf by using the following code from Otto Frost:
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c6b79908-0a01-0010-8ca0-b77aff37726d">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c6b79908-0a01-0010-8ca0-b77aff37726d</a>
(Very helpful, thank you very much!)
When extracting the zip archive with winzip or gzip(unix) Adobe Reader only shows an empty page. If I compare the original pdf-file with the extracted one, using a text editor, the difference is, that the extracted file has more line-feeds than the original one. When removing these line-feeds manually, the pdf works.
Has anyone an idea what can be the reason of this mistake.
Best regards
Gerald Seizinger
Message was edited by:
        Gerald Seizinger

Hi Julio,
  Thanks for your reply. Does it mean that this gzip only works in unix system, and not for windows system?
  Is there any other classes that I can use to zip a file into extension .rar or .zip?
  Kindly advise.
regards,
ginnie

Similar Messages

  • Saving a Text data to a PDF file without using print option

    Hi,
    I want to save a Text to a PDF file. I want to assign the path of the PDF file as a default one.
    If I use Print options, then it ask for the file path at the run time.
    Is there any method to save to a PDF file without using print option in Labview 8.2.
    Regards,
    Raja

    This question comes up a lot. Did you try searching? It depends on the PDF printer driver that you're using. See here, here, here, ...

  • Firefox 33 doesn't display a pdf file when using the response object

    Firefox 33.0.2 does not display pdf files when using the code below from an asp.net program, which works for previous versions of Firefox, and also works with IE. I'm using the built-in pdf viewer. All of my plugins are disabled.
    Dim strPDF As String
    strPDF = Session("filname") 'pdf filename
    Response.Clear()
    Response.ClearHeaders()
    Response.Buffer = True
    Response.ContentType = "application/pdf"
    Response.CacheControl = "Private"
    Response.AddHeader("Pragma", "no-cache")
    Response.AddHeader("Expires", "0")
    Response.AddHeader("Cache-Control", "no-store, no-cache, must-revalidate")
    Response.AddHeader("Content-Disposition", "inline; filename=" + strPDF)
    Response.WriteFile(strPDF)
    Response.Flush()
    Response.Close()
    Response.Clear()
    Response.End()
    Session("filname") = ""

    Thanks cor-el. You pointed me in the right direction. It appears to me that a reported Firefox 33 bug with the handling of compression (Transfer-Encoding: chunked) is the culprit (https://support.mozilla.org/en-US/questions/1026743). I was able to find a work-around by specifying the file size and buffering. Below is my code, with some code from http://www.codeproject.com/Questions/440054/How-to-Open-any-file-in-new-browser-tab-using-ASP.
    Dim strPDF As String
    strPDF = Session("filname") 'pdf filename
    Dim User As New WebClient()
    Dim FileBuffer As [Byte]() = User.DownloadData(strPDF)
    If Not (FileBuffer Is Nothing) Then
    Response.Clear()
    Response.ClearHeaders()
    Response.CacheControl = "Private"
    Response.AddHeader("Pragma", "no-cache")
    Response.AddHeader("Expires", "0")
    Response.AddHeader("Cache-Control", "no-store, no-cache, must-revalidate")
    Response.ContentType = "application/pdf"
    Response.AddHeader("content-length", FileBuffer.Length.ToString())
    Response.BinaryWrite(FileBuffer)
    Response.Flush()
    Response.Close()
    Response.Clear()
    Response.End()
    End If
    Session("filname") = ""

  • Quartz filter settings for compressing pdf file

    I have used the nominal quartz filter setting (reduce file size) to compress pdf file.  It reduced the file
    size significantly--but the text resolution was considerably blurred.
    What is an appropriate setting to reduce pdf file size and not destroy the test resolution ?

    See if this helps...
    https://discussions.apple.com/message/17870054#17870054

  • 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.

  • I use iMac desktop. I can't save web pages as PDF file by using Firefox, but by Safari is fine.

    I'm using Mac OS X 10.6.4. Today, I tried to save my email content as a PDF file. However, I only got a PDF file that have partial content of email. Then I adjust the printer setting and did it again, then I only got a blank PDF file. There was nothing inside. Then I tried to save email as a PDF file by using Safari browser. And I got a complete and sucessful PDF file. I usually save web pages or web mail, online receipt as PDF file by use Firefox. But since I have updated to the new version, there were many problems with my Firefox. I tried to restore all my application and made Firefox in the old 3.6.3 version which I used to have no problem. But now still not working.

    I solved it for myself: it was my HP smart-web printer crap that was a plug in and add on for firefox that somehow automatically got installed when I upgraded to 5. I disabled both in the add-ons manager, and voila, printing is working.
    It seems there are many things, like this and the Google toolbar, that were screwed by the oddly fast update to 5. Looks like Mozilla didn't give anybody any notice! Must've been some really bad security hole.

  • I use iMac desktop. I can't save web pages to PDF file by using Firefox, but by Safari is fine.

    I'm using Mac OS X 10.6.4. Today, I tried to save my email content as a PDF file. However, I only got a PDF file that have partial content of email. Then I adjust the printer setting and did it again, then I only got a blank PDF file. There was nothing inside. Then I tried to save email as a PDF file by using Safari browser. And I got a complete and sucessful PDF file. I usually save web pages or web mail, online receipt as PDF file by use Firefox. But since I have updated to the new version, there were many problems with my Firefox. I tried to restore all my application and made Firefox in the old 3.6.3 version which I used to have no problem. But now still not working.
    ''Duplicate post, continue [https://support.mozilla.com/en-US/questions/746583 here]''

    hello jlzibell, please go through the troubleshooting steps described at [[Websites say cookies are blocked - Unblock them]].

  • Recently my adobe is taking much longer to load PDF files that used to open immediately

    recently my adobe is taking much longer to load PDF files that used to load almost instantly

    Look at this comprehensive trouble shooting document;
    https://discussions.apple.com/docs/DOC-3353
    I suggest that you start with SMC and PRAM resets.
    Then  a Safe Boot.
    Ciao.

  • How to insert my signature in pdf file by using adobe?

    how to insert my digital signature in pdf file by using adobe

    Hi vani.boddu,
    If you're using Adobe Acrobat then refer the below links:
    Video : http://tv.adobe.com/watch/i-didnt-know-acrobat-xi-could-do-that-tutori als/sign-pdf-files-electronically/
    Document : http://help.adobe.com/en_US/acrobat/X/standard/using/WSAC8084C2-14F7-4 841-9EF8-92106D22C3DB.w.html
    If You're Using Adobe Reader
    Please refer : http://helpx.adobe.com/reader/using/sign-pdfs.html

  • How can we repeat specific page number of pdf file by using FDF Toolkit for Windows?

    how can we repeat specific page number of pdf file by using FDF Toolkit for Windows?

    let's say a registration form, there is only 1 full address provided in my registration pdf, but applicant could have more than 1 address, so i have to make it more flexible to extend the address page no matter how many addresses that applicant provided, i have use adobe acrobat pro to edit the form properties. but dont know how to extend/duplicate a page in felxible times.
    Please advise~ tks so much!!! George

  • Open *.PDF file by using ABAP program

    Hi,
    Can anyone please tell me about  " how to  open a PDF file by using an ABAP program".
    Regards,
    Prasanth

    Welcome to SDN.
    Refer this class - CL_GUI_PDF_VIEWER
    You may refer this thread also -
    Re: Open Jpg, Excel, word, pdf files from SAP screen.
    Regards,
    Amit

  • Creating an Adobe .pdf file without using the Adobe printer

    Is it possible to create a .pdf file by using Acrobat or Microsoft Word or any other program without using a printer driver? So far, when I remove the Adobe printer, I cannot create a .pdf file, as it is looking for the printer and printer driver. Is it even possible to create a .pdf without using, or having, a PDF printer of any sort? Any help on this issue would be most helpful. Thanks.

    I was trying to find a way to create PDFs without using the Adobe printer, or any PDF printer. I posed this question to see if there was a way to create a PDF without the aid of a printer or not. I mean, I know how to reinstall the Adobe printer, since I had to to see if there was another way to go about creating without using the printer. I am just curious if there is a way to create a PDF file without the aid of the Adobe printer or other PDF printers.

  • 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.

  • A simple and free way of reducing PDF file size using Preview

    Note: this is a copy and update of a 5 year old discussion in the Mac OS X 10.5 Leopard discussions which you can find here: https://discussions.apple.com/message/6109398#6109398
    This is a simple and free solution I found to reduce the file size of PDFs in OS X, without the high cost and awful UI of Acrobat Pro, and with acceptable quality. I still use it every day, although I have Acrobat Pro as part of Adove Creative Cloud subscription.
    Since quite a few people have found it useful and keep asking questions about the download location and destination of the filters, which have changed since 2007, I decided to write this update, and put it in this more current forum.
    Here is how to install it:
    Download the filters here: https://dl.dropboxusercontent.com/u/41548940/PDF%20compression%20filters%20%28Un zip%20and%20put%20in%20your%20Library%20folder%29.zip
    Unzip the downloaded file and copy the filters in the appropriate location (see below).
    Here is the appropriate location for the filters:
    This assumes that your startup disk's name is "Macintosh HD". If it is different, just replace "Macintosh HD" with the name of your startup disk.
    If you are running Lion or Mountain Lion (OS X 10.7.x or 10.8.x) then you should put the downloaded filters in "Macintosh HD/Library/PDF Services". This folder should already exist and contain files. Once you put the downloaded filters there, you should have for example one file with the following path:
    "Macintosh HD/Library/PDF Services/Reduce to 150 dpi average quality - STANDARD COMPRESSION.qfilter"
    If you are running an earlier vesion of OS X (10.6.x or earlier), then you should put the downloaded filters in "Macintosh HD/Library/Filters" and you should have for example one file with the following path:
    "Macintosh HD/Library/Filters/Reduce to 150 dpi average quality - STANDARD COMPRESSION.qfilter"
    Here is how to use it:
    Open a PDF file using Apple's Preview app,
    Choose Export (or Save As if you have on older version of Mac OS X) in the File menu,
    Choose PDF as a format
    In the "Quartz Filter" drop-down menu, choose a filter "Reduce to xxx dpi yyy quality"; "Reduce to 150 dpi average quality - STANDARD COMPRESSION" is a good trade-off between quality and file size
    Here is how it works:
    These are Quartz filters made with Apple Colorsinc Utility.
    They do two things:
    downsample images contained in a PDF to a target density such as 150 dpi,
    enable JPEG compression for those images with a low or medium setting.
    Which files does it work with?
    It works with most PDF files. However:
    It will generally work very well on unoptimized files such as scans made with the OS X scanning utility or PDFs produced via OS X printing dialog.
    It will not further compress well-optimized (comrpessed) files and might create bigger files than the originals,
    For some files it will create larger files than the originals. This can happen in particular when a PDF file contains other optomizations than image compression. There also seems to be a bug (reported to Apple) where in certain circumstances images in the target PDF are not JPEG compressed.
    What to do if it does not work for a file (target PDF is too big or even larger than the original PDF)?
    First,a good news: since you used a Save As or Export command, the original PDF is untouched.
    You can try another filter for a smaller size at the expense of quality.
    The year being 2013, it is now quite easy to send large files through the internet using Dropbox, yousendit.com, wetransfer.com etc. and you can use these services to send your original PDF file.
    There are other ways of reducing the size of a PDF file, such as apps in the Mac App store, or online services such as the free and simple http://smallpdf.com
    What else?
    Feel free to use/distribute/package in any way you like.

    Thanks ioscar.
    The original link should be back online soon.
    I believe this is a Dropbox error about the traffic generated by my Dropbox shared links.
    I use Dropbox mainly for my business and I am pretty upset by this situation.
    Since the filters themsemves are about 5KB, I doubt they are the cause for this Dropbox misbehavior!
    Anyway, I submitted a support ticket to Dropbox, and hope everything will be back to normal very soon.
    In the meantime, if you get the same error as ioscar when trying to download them, you can use the link in the blog posting he mentions.
    This is out of topic, but for those interested, here is my understanding of what happened with Dropbox.
    I did a few tests yesterday with large (up to 4GB) files and Dropbox shared links, trying to find the best way to send a 3 hour recording from French TV - French version of The Voice- to a friend's 5 year old son currently on vacation in Florida, and without access to French live or catch up TV services. One nice thing I found is that you can directly send the Dropbox download URL (the one from the Download button on the shared link page) to an AppleTV using AirFlick and it works well even for files with a large bitrate (except of course for the Dropbox maximum bandwidth per day limit!). Sadly, my Dropbox shared links were disabled before I could send anything to my friend.
    I may have used  a significant amount of bandwidth but nowhere near the 200GB/day limit of my Dropbox Pro account.
    I see 2 possible reasons to Dropbox freaking out:
    - My Dropbox Pro account is wronngly identified as a free account by Dropbox. Free Dropbox accounts have a 20GB/day limit, and it is possible that I reached this limit with my testing, I have a fast 200Mb/s internet access.
    - Or Dropbox miscalculates used bandwidth, counting the total size of the file for every download begun, and I started a lot of downloads, and skipped to the end of the video a lot of times on my Apple TV.

  • How to reduce size or compress PDF files?

    Hi guys,
    Does someone knows if there is a way  to reduce the size of the PDF file with good quality even on Pictures and Scanned documents? I know the option 'export', 'quartz filter' 'reduce size', but the compression is so extrem. Many files can't not been read, the quality is so bad. Is there a additional app, software or extension that let the user play with the compression on pdf files and let it be more personalized like the dopdf V7 available for windows? i am very dissapointed with this. Please help or suggestion. I will appreciate it. Thanks

    I have used the excellent PDF Toolkit app for a while, and its preformed well. Occassionaly it makes the document into a negative image...which Im noyt sure why...
    Mathishk, im trying your online version out, and am impressed and admire the fact that you have done this.
    Well done. 
    A TRICK i use often. Once all hires images are on the designed document - and its coming in at 15-20mb, just change the link to the images so they are 'missing' then make a pdf.
    i.e 'Hi Res images' to HRes images - old'
    The screen resolution of images is still great, but file comes in at fraction of the size.
    You 'trick' the document to use screen images only. So my 18mb file comes in as 5.2mb.
    Just remember to change the images folder name back, so files relink.
    Andy

Maybe you are looking for

  • How to get table having successfully created Vendor's Iban number.

    Hi All, Iam creating vendor using Maintain_Bapi of class VMD_EI_API. While creating bank deatils for some reason bank iban is not populating (when im checking it in XK03) apart from that other bank details are populating.  So, how can i check after v

  • ALERT: java/lang/ClassFormatError: Bad stack map.

    Hello friends. I need help. SOS. Where is wrong in this code? Problem is in comparision. Comenting this lines, all are ok.         if(time1==time2)             System.out.println("Equal");         else             System.out.println("Different");C�di

  • Customer/Supplier Ageing Screens and Reports

    Hi We have a request for change in the Customers/Suppliers Ageing screens and reports. Our clients require the appropriate transaction date field to be available on the detailed screen and the detailed report and statement. eg. If they are ageing by

  • Appraisal Documents POWL in ESS

    Hi all, I have a query regarding the possibility of creating document through ESS POWL not MSS, in MSS there is a create button to allow creation of document however this button is not available for ESS, in our process the employee will initiate a do

  • Using only one print statement ?

    Can you help me please? My program should contain single "System.out.print("*");", "System.out.print("+");", "System.out.print(".\n");" statements. That means, I'm only allowed to use them once and not allowed to use any other print statement. +. +*.