Skip to Content

SAP Archiving : zip archivefile and File does not begin with %PDF

Hello All ,

i use the cl_abap_gzip to compress an xstring buffer and after compressing i assigned the value of the compressed document to the initial one

the problem is when i go to VF03/VF02 or OAAD and when i want to display the archive i have the message

"File does not begin with %PDF"

Thank u in advance

* document is a pdfxstring 
*pdflen is a int with the length of pdfxstring CALL METHOD cl_abap_gzip=>compress_binary EXPORTING raw_in = document raw_in_len = pdflen compress_level = 6 IMPORTING gzip_out = gzip_out gzip_out_len = gzip_out_len. if sy-subrc = 0 . clear document. clear pdflen. document = gzip_out. pdflen = gzip_out_len. ENDIF.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • May 19, 2017 at 10:41 AM

    It's not very clear, but I assume you made a custom program to gzip a PDF archive, and now when you try to open it, there's an error message which says it's not a PDF file.

    The error message makes sense, if the file name has still the extension .pdf, SAP/Windows expects a PDF file, not a GZIP file.

    By the way, you should better use ZIP, not GZIP ! GZIP cannot be opened from standard Windows installation. A ZIP file can. Use CL_ABAP_ZIP instead of CL_ABAP_GZIP.

    Add comment
    10|10000 characters needed characters exceeded

  • May 19, 2017 at 02:03 PM

    If the question is "which standard code is to enhance to unzip the archived PDF file (zipped by your custom code) while displaying it via the GOS toolbox ?", then maybe the concerned code is the function module ARCHIVOBJECT_DISPLAY. Add an external break-point (as the display is probably asynchronous) to make sure this is the one called.

    Add comment
    10|10000 characters needed characters exceeded

  • May 19, 2017 at 02:08 PM

    Yes , i found that FM but here i didn't found the compressed buffer to uncompress

    we have just parameters in exporting and gs_connection-reserve is 'PDF'

    u see ?

    Add comment
    10|10000 characters needed characters exceeded

  • May 22, 2017 at 05:00 PM

    if i have the content_bin and the size of this binary content , how can i unzip this data with CL_ABAP_ZIP , to avoid GZIP ?

    Add comment
    10|10000 characters needed characters exceeded

  • May 25, 2017 at 02:55 PM

    I have the feeling that the compression should be a major feature of any Content Management System (I could see that it's the default behavior of SAP Content Server). Shouldn't you first ask if this is possible to compress automatically with your CMS ? (then, the best place is the web site of the CMS, not the SAP forums).

    Add comment
    10|10000 characters needed characters exceeded