Skip to Content
0
Former Member
Oct 19, 2006 at 06:48 PM

PDF conversion with windows 2000 not working

19 Views

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( ).