Store pdf from ArchiveLink (binary) down to Netweaver file system

Hello!
I have a problem: I need to extract a pdf-file which is stored in table TOA01 in binary format. The pdf should be generated and stored into a pdf-file in the file system of the Netweaver application server.
The main problem: Whenever I extract the data from the table and write it down to a file, the data in the pdf-file is corrupted. I tried all kinds of convertation routines (OFT to Binary, OTF to XString, Binary to XString,...)
Can anybody help me with my problem? I need a pdf from the ArchiveLink table as a file on the filesystem.
Thank you for your help!
Best regards,
Markus

Hello Otto!
thanks for your help. I compared the input- und the output-data now and discovered, that the data is identically. The problem which causes my problem, lies in the writing of the data into the file by dataset.
First, I extract my pdf binary data from database table with the following function module.
CALL FUNCTION 'SCMS_AO_TABLE_GET'
        EXPORTING
          arc_id       = ls_toa01-archiv_id
          doc_id       = ls_toa01-arc_doc_id
          comp_id      = 'data'
        IMPORTING
          length       = filesize
        TABLES
          data         = lt_data
        EXCEPTIONS
          error_http   = 1
          error_archiv = 2
          error_kernel = 3
          error_config = 4
          OTHERS       = 5.
      IF sy-subrc <> 0.
        RAISE error_retrieving_file.
      ENDIF.
The result of this operation is stored in lt_data and seems to be correct. I compared the filesize of a pdf which I downloaded from GUI and lt_data. The size is exactly the same amount of bytes.
This is the coding part which doesn't work properliy is the following:
      OPEN DATASET lv_pdf FOR OUTPUT IN BINARY MODE.
      IF sy-subrc = 0.
      LOOP AT lt_data INTO ls_data.
        transfer ls_data TO lv_pdf.
      ENDLOOP.
      ELSE.
        RAISE error_writing_file.
      ENDIF.
      CLOSE DATASET lv_pdf.
When the data is written into the dataset, the resulting file is corrupted in a certain way. I compared the binary content of both files, the correct one and the file created with the dataset part and discovered, that the data is identically. Only some line breaks are different. The result of this little differences is a blank pdf file instead of the correct one with text. Seems like really every single bit position has to be identically to the working pdf. If there is one space in the file too much or one line break, the pdf is corrupted.
Can anybody help me and describe how to create a pdf file out of an internal table?
Best regards,
Markus

Similar Messages

  • Cannot print pdf from Excel. Saving as log file

    I am trying to print an Excel page to pdf and everytime I get an error.
    I am using Adobe Acrobat 9 and Excel 2010

    You printed to Adobe PDF from excel.
    There was an error which prevented the pdf from being created.
    That log file lists the errors and seeing it's content might enable us to determine why the job failed.
    Open the log file with Notepad or any text editor (Word)
    Copy that text to this forum

  • Creating PDF from XML directly in a content management system?

    Hi!
    This is my first post here and I've tried to find any previous posts that could answer my question but to no avail. Also I think and hope this is the correct sub forum to post it in.
    I work at a company that produces a product catalogue that is published as a webpage, a PDF document (used as the basis for a tablet app) and a printed catalogue from a PDF. For the PDF (used in the tablet app and the printed catalogue) we are using a CMS based on XML that produces Adobe FrameMaker documents which we then export the PDF from. We are looking in to updating the system and make it flow much better but are a bit uncertain of what the best way to go would be.
    A solution I'm thinking of would be to have the content of the product catalogue in some kind of XML based service that can export the information in XML. This would hopefully make it possible to send the documents either directly to PDF by XML and some style sheets or import the XML into some InDesign templates (for the more complicated designs at intro pages etc).
    One important aspect of the product catalogue is that we have all information saved in different languages so there has to be some kind of connection between the templates and different language versions -- ie. the page design but different language text flows for each language edition.
    What I wonder is. What kind of services/solutions would there be that handles XML to PDF for a quite complicated product catalogue (ie. the different language versions)?
    Thanks in advance!

    The difference between the two packages is that PatternStream effectively works on a "pull" principle (the content is retrieved into the template(s) by queries at the appropriate locations), while Miramo is a "push" (the tagged content is processed by Miramo using templates to create the DTP files). SInce Miramo allows programatical processing before the content is pushed into the DTP app, you can do all sorts of manipulations, conditional processing, automatically insert markers and variables, etc. so it allows for a fairly complex layout, even with FrameMaker. It also allows api's and scripts to be triggered at the backend when the publication has been assembled for further processing/manipulation.
    Is there any particular reason that you want to move from the FM engine to the ID one? In terms of throughpu,t FM streams run very much faster than ID ones. Also, unless the layouts are extremely complex, in an automated environment, there are very few catalogue layouts that I've seen that couldn't also be handled using a FM workflow.
    Are there any samples on line of the types of catalogues that you are currently producing? This would help in assessing which tools and workflows might be more appropriate to your situation.

  • Upload attachements from Windows and Save them to File System

    Hi
    We are upgrading to 11.5.10, using Database 10g r2. Can any one help me to upload attachement from a PC and save to a Unix file system instead of database. We are using forms 6i. Please help.

    Hi
    We are upgrading to 11.5.10, using Database 10g r2. Can any one help me to upload attachement from a PC and save to a Unix file system instead of database. We are using forms 6i. Please help.

  • Image: display from local drive, upload to server file system, and display from server

    Hello,
    I am using jdev 11.1.2.4.0...
    The requirement is that users would like to upload images from their local drive to server drive and they would like display images from server drive later.
    We don't want to keep images in database. I am not sure what the solution should be; however, I plan to ....
    1. create a table to keep an information of images -- image_id, image_location (server drive), image_filename
    2. create a page where users can enter image information and specific filename from a local drive (I think I will use inputFile component) and provide the preview button to display an image on screen before save it. To save data is to save information to the database and copy an image file to the server drive (the destination location for image files is predefined.)
    3. create another page where users can browse information from the database and display an image for a selected record by getting from the server.
    I need suggestions on...
    1. how to display an image on page from the local drive?
    2. how to copy a file from a local drive to a server?
    3. how to display an image on page from the server drive?
    Thank you.
    nat

    See:
    http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-1/
    http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-2/
    http://tompeez.wordpress.com/2011/12/16/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-3/
    Where Timo saves images to the database, you save it to the file system (examples on how to do this from Java are available plenty if you just Google for it). Similar to Timo you then use the image tag to display images. The difference is that you can directly add the URL from the database table.
    The benefit of using a database to host images is that you are not dependent on file server structures though
    Frank

  • Download a PDF from an URL to a local file

    Hi all,
    we are trying to get a pdf file from the internet with FM HTTP_GET, and after that download to a local file with WS_DOWNLOAD.
    Our problem is that we do not know wich type of table to use in order to retrieve the RESPONSE_ENTITY_BODY from HTTP_GET.
    Sometimes the PDF have 4000 of length sometimes 1200.
    Could you please help us?
    Regards,
    Rubé

    hi
    you can have a look at RSHTTP* programs.thta is ,for cl_http_client demo program try RSHTTP01 and for http_get demo program try RSHTTP20.
    hope this helps
    regards
    Aakash Banga

  • Printing PDFs from Photoshop CS5 creates unworkable miniature files

    I work on Photoshop CS5 files and print them to pdf all day long with no trouble, most of the time. Occasionally however I complete a file in Photoshop and print to pdf and the file outputs as some kind of completely unworkable miniature. Very small file that fits in a tiny corner of the canvas size it should occupy. Once this occurs I must reboot my computer 3-4 times before the print to pdf features returns to normal function.  Today this happened on two separate computers almost simultaneously after I switched over from one to the other to get this job out and it occurred to me it might have been the actual file I was working with. Corrupt or something. The I tested some files that had worked in the past and they too went "miniature".  When this happens I save as pdf just to get the job out. While this works, the saved pdf is always a much larger file than the printed pdf version, with completely similar resolution quality. I love my print pdf feature, but it seems to have developed a little occasional psychosis in version CS5 and I was wondering if anyone has a fix up their sleeve, or can tell me what setting I am accidentally activating to make the output so tiny. It's pretty frustrating.
    Hans Matthes

    I advise you to contact Adobe Technical support through phone
    or you may also refer the acrobat user forums posted on adobe.com
    website

  • Create a pdf from Webdynpro Java DC & save the file locally

    Hi
    I have a webdynpro application in which I want a functionality to create a PDF and save the PDF locally on the desktop.
    I want to create a button in the view which should trigger an action to generate a pdf automatically and should give an option to the user to open/save the pdf file locally on the desktop.
    Kindly share the sample code or a blog which talks about the same.
    Regards,
    Anurag Gwari

    Hi,
    Check these forum threads and Links.
    Forum Threads:
    [create Adobe PDF|Re: create Adobe PDF;
    [ Create PDF and Save in User's desktop |Create PDF and Save in User's desktop;
    Documents:
    [Adobe Online Interactive Forms Integration into Web Dynpro for Java Applications|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2b6db1c4-0801-0010-faa5-ff4b4df55b45]
    [Dynamically Generated Forms in Web Dynpro|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/63f09fc2-0401-0010-1482-dbf9891e7613]
    Regards,
    Anand G

  • Bug report: "convert to pdf" from explorer on set of .psd files prints documents on physical printer

    I've recorded a tiny screen video to show this bug:
    Please note,that printer window error 6000 is as expected (since I don't actually need to print this stuff).

    I have a little speculation about this. Maybe...
    I speculate that Acrobat will offer "convert to Adobe PDF" for any file where it finds a "print" verb available in the Windows shell. Acrobat assumes it can to a ShellExecute printto Adobe PDF. (It works for files you can drag to a specific nondefault printer in the printers control panel).
    So, Acrobat doesn't understand PSD files and Photoshop doesn't know anything about Acrobat (though it can of course save as PDF, no connection to this). But because Photoshop offers a service to Windows, and Acrobat tries to use that service unsuccessfully, we end up with this mess.
    So, Acrobat may offer conversion for whole classes of file which are quite surprising; and it won't always work (generally for a whole class of file).
    End of speculation.

  • How can I create one pdf from a FrameMaker Book with mixed page sizes.

    Looking for an easier way to create one pdf from a FrameMaker book that has files with different pages sizes; letter and tabloid.
    So far, I have not been able to find a way to set up the Adobe PDF printer or Distiller to read the page size from the source files in the book and then create one pdf with the appropriate page sizes based on the file sizes in the FrameMaker book. I can create a pdf of the book using a multi-step process where I create a pdf for each page size and then combine them into one file. This is a lot of work.
    Is there a way to set the Adobe PDF printer where it reads page size from the source files and then creates one pdf with a mixed page sizes?
    Using FrameMaker 7 and 10 and Acrobat X Pro.
    Thanks for any suggestions

    http://forums.adobe.com/message/4013068#4013068
    http://forums.adobe.com/message/3519366#3519366
    http://forums.adobe.com/thread/485331?tstart=0

  • Javascript error when launching XFA pdf from browser

    Hi all,
    I am trying to use my XFA PDF from a browser. On my local system I have  set up a web server and am launching my PDF from there. However, I am getting a ReferenceError with regards to one of my Javascript functions.
    My PDF has dependency on a javascript file that resides in the Acrobat path as follows:
    C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts\
    When I use my PDF directly from an Acrobat instance, everything works fine. The issue comes up only when launching from server. How do I link the javascript file to my PDF?
    Edit: The user is going to be launching the PDF from the server via a web browser. In such a case where do I place the javascripts?
    Help appreciated,
    Thanks

    @George: thanks for the quick response!
    My JS code contains a readFileIntoStream which I learnt is also to be run under privileged context. (still learning the ropes here.. ).  I have been trying to incorporate the JS code directly into the PDF to get around this privileged context..  but I am unable to find a non-privileged equivalent for readFileIntoStream..
    Basically my users would be accessing the PDF from the server direct via the browser. For my testing purposes I am able to run the PDF directly from my desktop via an Acrobat instance without any hitch as the scripts are folder level like you mentioned. Is it possible for the users to be able to access the javascripts from anywhere on the server rather than directly from the PDF?  Please note, users will not be saving copies of the PDF on to their local machines (in which case we could have pushed the JS file along to their machines) . I need to ultimately run the PDF from browser.
    I hope I am clear..
    Thanks.

  • "stopped" status while creating pdf from AI

    Hi, my friend taught me a way (to "print" pdf) to create PDF from illustrator that could make the file size much smaller, but now my question is, it works in my macbook (ppd version 1.1) but not my desktop imac (ppd version 1.0), the printer status always jump to stopped during the process of creating the PDF, anyone got any idea why? is it because of ppd version different? where can i donwload the latest ppd version. Many Thanks.

    What is the LiveCycle version?
    Is it possible for you to share an example(somewhere on public file sharing sites)?

  • Using a trial version of Acrobat X1 I am unable to open pdfs from Firefox. Solution?

    Using a trial version of Acrobat X1 I am unable to open pdfs from Firefox. Solution?

    Which operating system?
    Have you tried using other browsers?

  • Extract & Store pdf SD billing document from archivelink content Repository

    Hello friends,
    Can some one give me a hint on this :
    I have a requirement to create a program which will extract the pdf SD billing document from archivelink content Repository and will save pdf files on application servers's directory.
    We have business Object, Content Repository ID, Document type know for this.
    thanks
    ashish

    use FM : ARCHIVOBJECT_GET_TABLE to get the content in bin format..
    then use open dataset, transfer dataset, close dataset to store that in OS level.. task done..
    you can even use GUI_DOWNLOAD if you want to download it to presentation server.

  • Since downloading the iOS on my iPad, I cannot download more than one pdf from mail to iBooks.  I have to shut down y iPad and start again.  Any suggestions?

    Since downloading iOS on my new iPad, I cannot downlaod more than one pdf from mail into iBooks.  I have to shut down my iPad and restart it to save a second pdf. Wasn't a problem with the old operating system.  Any suggestions?

    It seems that I have solved my issue by performing a full factory reset (erasing all content, something which I had hoped to avoid) restoring from an iCloud backup did not alleviate the issue, I had to set up as a new iPad.
    Hopefully anyone else else who has this issue in the future will be able to find this.

Maybe you are looking for

  • User event for array of waveforms with attribute

    I have been transferring data in a Producer/Consumer architecture via User Events.  The data consisted of an array of waveforms. When I added an attribute to the waveforms the code breaks with two errors about Create User Event: User event data type

  • Problems with displaying text from gtk+-2.0 with Cairo

    I've got a 64-bit app that uses gtk+-2.0 (2.8.17 with Cairo). I had to build my own libraries since the gtk+-2.0 libraries Solaris 10 ships with is 32-bit only (and does not contain Cairo support). The app is statically linked so that our customers d

  • Error when deploy to tomcat

    Hi, i deploy project created by creator in tomcat 5.5.20, i display first that not contain database interaction, but if i move to the next page i have this error com.sun.rave.web.ui.appbase.ApplicationException: org.apache.jasper.JasperException: jav

  • Using Personal Domain Name with iWeb08

    As per instructions I have setup my domain and made the changes to the Cname records with my Domain Registry ( https://cp.domaincentral.com.au). Domain is noted at the bottom of iWeb as I would expect and also if I upload I get the notation that the

  • Netweaver Standards supported by XI

    Hi, Can someone explain the necessary Netweaver Standards supported by XI? regards Reema