cancel
Showing results for 
Search instead for 
Did you mean: 

PDF conversion with windows 2000 not working

Former Member
0 Kudos

Hello all, I have a BSP application that is up and running. When I print with an XP machine, I have no problems. When I print with a windows 2000 machine, I am looping and never getting to the PDF open screen. It just keeps looping but if I try from a XP machine, everything works.

Any help would be appreciated. i have included some of the code.

*-----------------------------------------------------------------------
* Conversion of output format OTF into PDF format
*-----------------------------------------------------------------------
* now convert the final document (OTF format) into PDF format
  call function 'CONVERT_OTF'
       exporting
         format                      = 'PDF'
*         MAX_LINEWIDTH               = 132
*        ARCHIVE_INDEX               = ' '
*        COPYNUMBER                  = 0
       importing
         bin_filesize                = l_pdf_len
         bin_file                    = l_pdf_xstring       " binary file
       tables
         otf                         = ls_output_data-otfdata
         lines                       = lt_lines
       exceptions
         err_max_linewidth           = 1
         err_format                  = 2
         err_conv_not_possible       = 3
         err_bad_otf                 = 4
         others                      = 5
                .
  if sy-subrc <> 0.
*   error handling
*    message id sy-msgid type sy-msgty number sy-msgno
*            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.

*-----------------------------------------------------------------------
* Fill HTTP request
*-----------------------------------------------------------------------
  response->set_header_field( name  = 'content-type'
                              value = 'application/pdf' ).

* response->delete_header_field( name = 'pragma' ).
* response->delete_header_field( name = 'expires' ).
* response->delete_header_field( name = 'cache-control' ).

* some Browsers have caching problems when loading PDF format
 response->set_header_field(
                    name  = 'cache-control'
                    value = 'max-age=0' ).

* start PDF viewer either in the Browser or as a separate window
  if pdf_in_browser is initial.
     response->set_header_field(
                        name  = 'content-disposition'
                        value = 'attachment; filename=BenConf.pdf' ).
  endif.

* finally display PDF format in Browser
  l_pdf_len = xstrlen( l_pdf_xstring ).
  response->set_data( data   = l_pdf_xstring
                      length = l_pdf_len ).

  navigation->response_complete( ).

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

No, that didn't work either. It's just streange, it is only having the problem on 2000 machines.

guillaume-hrc
Active Contributor
0 Kudos

Could it come from different Web browsers settings on the 2 environments ?

Try a different browser (Firefox, IE, ...) ?

Best regards,

Guillaume

former_member181879
Active Contributor
0 Kudos

You must remove all the no-cache headers and definitely disable GZIP compression for PDF files.

Look at <a href="https://wiki.sdn.sap.com/wiki/display/BSP">BSP Wiki</a>:

  • Handling Binary Data

  • PDF

Former Member
0 Kudos

Just to add, the conversion is working, its the display of the output that never happens. I never see the PDF inmage but there is data. Sorry for the confusion.

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Try removing the "attachment; "

Best regards,

Guillaume