Converting Base64Binary to PDF document in BSP

Hello SDN users,
I am trying to get and display a pdf document from a webservice which is provided as a base64binary.
The interface of the webservice tells me that the response type (the actual pdf document) is an xsd:base64Binary.
The webservice proxy class generates an RAWSTRING for the pdf document as the response from the webservice call.
So my first guess was to use following class method to convert the base64binary to a normal string
   CALL METHOD cl_http_utility=>if_http_utility~decode_base64
      EXPORTING
        encoded = lv_out_char " RAWSTRING from webservice
      RECEIVING
        decoded = lv_out_char_decoded.
My second guess was to create an xstring from this converted string via
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
      EXPORTING
        text   = lv_out_char_decoded"
        mimetype = 'APPLICATION/PDF'
      IMPORTING
        buffer = lv_out_charx.
My next assumption was to create otf-data via function module so that I can send the otf data to the http server cache.
lv_pdf_len = XSTRLEN( lv_out_charx ).
call function 'CONVERT_OTF'
    EXPORTING
      format                = 'PDF'
    IMPORTING
      bin_filesize          = lv_pdf_len
      bin_file              = lv_out_charx
    TABLES
      OTF                   = LT_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.
My Problem is, that I get back error code 4 which means bad otf.
Does anyone has a hint how I need to convert the base64binary from the webservice to a right format?
That would be great!

Hello Durairaj,
thank you very much for your answer,
is it usual that the method
CALL METHOD cl_http_utility=>if_http_utility~decode_base64
      EXPORTING
        encoded = lv_out_char " RAWSTRING from webservice
      RECEIVING
        decoded = lv_out_char_decoded.
returns a string containg something like %pdf...? This was not the case with my method call.
But on friday I found out why. the string I received from the webservice was actually an XSTRING which I found out during a debugging session. The method return parameter was declared  as RAWSTRING so I assumed that I had to convert from Base64 to STRING and then to XSTRING. When I aborted all the converting routines
if_http_utility~decode_base64
and
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
and passed the XSTRING to the ICM server cache I received the pdf I wanted.
But anyway If you could confirm my second question how a a decoded Base64 attribute should look  like I would be very happy.
Regards,
Sebastian

Similar Messages

  • How do I convert a Dutch pdf document to Word ?

    How do I convert a Dutch pdf document to Word ?

    While the ExportPDF service doesn't support Dutch at this time, it does support French, which uses a similar character set.  You may want to try choosing French as the OCR language.
    Let us know how it goes.
    -David

  • How can I convert a secure pdf document into word?

    How can I convert a secure pdf document into word?

    Hi,
    Please refer to below mentioned article:
    http://forums.adobe.com/docs/DOC-1515
    ~PRanav

  • Converting JTable to Pdf document

    hello executives,
    i m new to java.
    can u send code that converts JTable into PDF Document.
    please mention the packages possible to use and their downloads .
    Regards --------RAM

    I cannot give you exact code to do it but I can give to a starting point to go from.
    First, if you have a PDF to start from and want to be able to generate certain values onto the form, then you should get a convertor to translate the PDF into a XSL-FO file. From that file you can modify it to suit your needs.
    This is the convertor that I used in my project: http://www.oneday.com.au/
    I got FOP from here: http://xml.apache.org/fop/download.html
    You can surely search google for a good starting place since I am sure what I have said is not a great help at all. Hopefully you received the right tools to get you on your way.

  • I'm trying to convert a large PDF document to word but it keeps failing. What can I do? I'm on Windows 7.

    I'm trying to convert a large PDF document to word but it keeps failing. What can I do? I'm on Windows 7.

    Something to try - use Acrobat to extract small page counts (say 10 pages) to have smaller page size PDF files. Export these to Word files. Then  bring those together.
    Be well...

  • Word macros are disabled after converting to a PDF document.

    We work with Word templates that contain macros.
    After you convert a Word document into a PDF document, the macros of the attached template are disabled.
    The conversion takes place via the Adobe Acrobat icons.
    Used Products:
    - Windows7
    - With Office 2007 SP2
    - Adobe Acrobat 9.3.3 Pro
    The described problem only occurs in Word.  Outlook, Excel and Power Point are not affected.
    Thank you for your time and help

    Hi Buster,
    The error message you were receiving occurs when you try to convert a dynamic PDF file created with Adobe LiveCycle Designer.  This file is usually already a fillable form.  Unfortunately there is no workaround available for converting documents like this within the ExportPDF service.
    I'm sorry for the inconvenience.
    Please let me know if you have any questions or if I can be of further assistance.
    -David

  • I have Adoby PDF.  How do I convert a scaned PDF document to Word?

    I have Adoby Export PDF.  How do I convert a scsned PDF to a Word document?

    Hi William,
    Here you go!
    How to export your PDF file to Word file:
    1.Log into https://exportpdf.acrobat.com/signin.html with your Adobe ID and password
    2. Select "Export from PDF' from right pane
    3. Click "Select Files" button then choose your PDF file for exporting to Word file
    4. Select a format like docx or doc for Word file
    5. Check On for "Recognize scanned text in" if your PDF file contains scanned images
    6. Click "Export" button
    7. Download the Word file by clicking "Download" in the progress bar
    8. Open the Word file in Microsoft Word for editing.
    Or you can export your PDF file in Adobe Reader
    1. Launch Adobe Reader and open your PDF file
    2. Select "Tools" and click "Sign In" link to sign in with your Adobe ID and password
    3. Select "Export PDF"
    4. Click "Convert" button
    5. Click "Download Converted File" link to download the exported Word file to your computer.
    Regards, Stacy

  • I have a cd with scans of a document. How do I convert to a pdf document?

    I want to convert the contents of a cd to a pdf document. I am new to this and the first time I have attempted this. Any help is greatly appreciated.

    Maybe the problem you are having with the multiple files option is that you are not changing the file type box to see all, only looking at the default PDF files. Change the file type to all or (*.*) and then look for the files. Select them all (ctrl key allows you to select them each as you hold the key, or shift key allows you to select a range of files) and then complete the conversion. You may have to reorder the pages with the pages tab.

  • Converting webpage to PDF document

    Using Acrobat 8 Pro under Vista Home Premium, when I upgraded/updated from 8.0.0 to 8.1.6, I lost the Adobe PDF icon in the upper right hand portion of the Internet Explorer toolbar. I have been able to click on this icon to convert the webpage to a PDF document. Now that icon is gone. What do I need to do to restore this function?

    I cannot give you exact code to do it but I can give to a starting point to go from.
    First, if you have a PDF to start from and want to be able to generate certain values onto the form, then you should get a convertor to translate the PDF into a XSL-FO file. From that file you can modify it to suit your needs.
    This is the convertor that I used in my project: http://www.oneday.com.au/
    I got FOP from here: http://xml.apache.org/fop/download.html
    You can surely search google for a good starting place since I am sure what I have said is not a great help at all. Hopefully you received the right tools to get you on your way.

  • Convert part of pdf document to word

    I need to convert part of a document to word not the whole document as is way to big and  i do neot need the other parts. can I do that and how?

    Hi Pistonvandrom,
    Unfortunately, it is not possible to convert a part of document via Adobe ExportPDF, it is only possible if you use the complete PDF solution Adobe Acrobat.
    For More details: http://www.adobe.com/products/acrobat.html?promoid=JOLIR
    let me know if you have any other question
    Regards,
    ~PRanav

  • I'm a new customer and I've converted only 2 PDF documents, and neither document do the images show up, nor do they keep the same format.  If this is what I bought, then I want a refund too.

    Is it possible to keep the same format with the images when converting.

    Hi,
    May i know this is happening with these 2 files only or with every files?
    Would it be possible for you to send me the document?
    So that i can check what is the actual issue.
    Regards,
    Florence

  • Convert PDF Document to PDF with Spot Color

    I want to convert a regular PDF document with RGB/CMYK color profile to one with Spot color. Can this be done using Acrobat X Pro, if so How?

    Hi Steve
    I am still working on the process to automate the conversion of PDF file with RGB color profile to Spot.
    I am nearly there, here is the method...
    1. Have a prefight profile with the spot color fixes. For now I put in 10 colors.
    2. Wrote a Javascript that will invoke the preflight profile
    3. Cretated an application (AutoSpotFix) in VC++ and Acrobat SDK that will open the document and assign the javascript function to 'WillSave' document action. The AutoSpotFix will then trigger the save on the document.
    Java script had to be involved because SDK cannot invoke the preflight profile.
    Now my problem is the document can contain any spot color, I need to
    a) Either put in the thousands of spot color into my preflight profile, which will take days to do. Or I can create a preflight profile file (*.kfp) and load it, which is an XML file.
    b) Dynamically load the preflight profile file with the few current colors, for which I need to dynamically create the preflifgt profile.
    Either way I have to create the *.kfp file, Is there a way to create the Preflight profile file?

  • Converting pdf document to interactive pdf document

    How can I convert an existing pdf document to an interactive fill and print pdf document ?  I am using Adobe 9 Standard.

    Thanks, I have tried that and also just downloaded trial version of Adobe X .  Problem I am having is that program converts many of the sections of the document to interactive fields but unfortunately not all that I need and I don’t see how to get it to convert all in the original document.  Basically got same result with same fields converted whether using Adobe 9 or the Adobe X trial version.  This is a Tax Organizer Form I use to gather client data (they fill in a printed paper version by hand) and would like to have a pdf version to provide them with interactive fill in the blank capability but so far not all required fields are getting converted.

  • Convert multipage Spool (ALF)  into separated PDF documents

    Hi,
    is it possible to convert one multipage ABAP spool(ALF) into separated PDF documents. For example: I have a spool with 3 pages and want to convert it into 3 different PDF documents.
    With function 'CONVERT_ABAPSPOOLJOB_2_PDF' I can only convert into one PDF document.
    Thanks in advance,
    René

    hi,
    Welcome to SDN forum.
    Refer to these links
    Re: ALV List as PDF
    Re: Print to PDF file
    Reward with points if it is helpful
    Regards
    Alfred

  • CJK characters are not converted correctly to PDF

    We are developing layout using SMARTFORMS. We are using standard function module 'CONVERT_OTFSPOOLJOB_2_PDF'  to convert the SMARTFORM to PDF. Chinese, Japanese, Korean characters are not displayed/Converted correctly in PDF documents. But in Spool these characters are showing correctly.
    Whereas German, Italian, French are displaying and printing correctly and converting properly to PDF.Please suggest a suitable
    note/correction for the above.

    Hello dear,
    Did you got a solution for this? Even i am facing the smae problem.
    Warm regards,
    Harshad.

Maybe you are looking for

  • Usb - 6009 Device Recongition Problems

    Hi, I just got a USB-6009 DAQ. I have labview 7.0, drivers software and the supplied software installed with no problems. In the measurment nad automation explorer (MAX) the device is recongnised and declared problem free. I tried to test the device

  • Not Able to use Mail.app

    Hello to everyone. After been browsing this site and google for about 2 days I have decided to post this message and see if someone can help me fix the problem I am having. My mail.app has been not working for me ever since I got my new mac and migra

  • SQL Query problem (PL/SQL function returning SQl query)

    I am using 3.1.2 Apex. When I create the region source with the following code. DECLARE l_sql VARCHAR2(32767); X1 VARCHAR2(9); X2 VARCHAR2(9); X3 VARCHAR2(9); X4 VARCHAR2(9); X5 VARCHAR2(9); X6 VARCHAR2(9); X7 VARCHAR2(9); X8 VARCHAR2(9); BEGIN SELEC

  • Configuration issue with ISMBP_CREATE IDOC

    Hi Experts, Currently my client is creating Business Partners through BP transaction. The issue now we have is that create and changes made using a BAPI for creation  BAPIBUSISM007_CREATEFROMDATA and change BAPIBUSISM007_CHANGE. For both bapis i have

  • Apple TV screen

    Hello everyone, I purchased the new Apple TV 3 today.  We hooked it up without a hitch and got into everything fine, then my sister turned it off.  Awhile later she went to put it back on and on the screen was a picture of the apple tv, connection pl