Leave feedback
  • Question

    XML with base64 encoded files to an AFP

Enter a new topic
  • Therese Lindgren Therese Lindgren
    0 likes 527 views

    Hi,
    we’re about to create a solution which accepts a XML with base64 encoded files (PDF).
    In this forum we found ways to transform the files via strings to a temp file and then into PDF using base64 methods.

    Our problem is how to process the files and add them into an AFP-file, which is the given output format for our system.
    We’re using a StoryTeller Process to create a flyleaf and then we want to enclose the PDF-files.

    Is there anyone who has done this? Should we use StoryTeller or is there a better way to handle PDF-files?

    Or is it so that we shouldn’t do this at all, and not use the AFP-format for this solution? 

    The files are multi page PDF and can contain text as well as pictures. 

    Version 5.6.2 GA Build 678, Cumulative fix 2 (840).

    Regards,

    Therese

    Tuesday 19 December, 2017
  • David Bares David Bares OpenText Employee Administrator StreamServe Employee
    2 likes

    StoryTeller will read the PDF into internal format that can then be translated to AFP same as other output to StoryTeller.

    in 5.6.2 you will have to use the functions that store the base64 embedded data to files that you can then use to load the PDFs from.

    In version 16 we can do that without touching the disk.

    I suppose you can find how to render multipage overlays (PDFs in your case) in StoryTeller in this forum somewhere.

    If not, attach your input data and I can try to elaborate something.

    Tuesday 19 December, 2017
  • Therese Lindgren Therese Lindgren
    0 likes

    Hi,

    Thank you for your answer.

    We’ve succeded to create an PDF by writing the text into a tempfile (txt). We open and write (“wb”) the string from the XML on a file, close the file and call the base64Decode method. The PDF looks fine when we open it manually but the errorcode indicates somethings wrong: “Operation not permitted.”

    We’ve tried to reopen the temp file and open the new file before calling the method but it dosen’t make any difference. Any idea on what we're doing wrong?

    Regards,

    Therese

    2 weeks ago
  • David Bares David Bares OpenText Employee Administrator StreamServe Employee
    0 likes

    Check in Document Properties (Ctrl+D) that the PDF is not prohibitted from printing or copying content.

    StreamServe honors these settings and would not open PDFs that are not supposed to be reprocessed.

    2 weeks ago
  • Therese Lindgren Therese Lindgren
    0 likes

    Hello,

    We checked the document properties and it looks like nothing is prohibited.

     

    2 weeks ago
  • David Bares David Bares OpenText Employee Administrator StreamServe Employee
    0 likes

    Could you by chance impersonate the XML and attach it for us to look at?

    2 weeks ago
  • Therese Lindgren Therese Lindgren
    0 likes

    This pdf doesn't contain much, but it still generates the same error code.

    2 weeks ago

    Attached files

  • David Bares David Bares OpenText Employee Administrator StreamServe Employee
    0 likes

    The PDF file opens normally in StoryTeller.

    What is it that you are doing that generates the "Operation not permitted." message?

    2 weeks ago
  • Therese Lindgren Therese Lindgren
    0 likes

    This is in script before message.

    2 weeks ago
  • Therese Lindgren Therese Lindgren
    0 likes

    Hello again,

    We just discovered that the we maybe made something wrong when we check the error code from function Base64DecodeFile. We check if errorcode !=0 but according to documentation it returns 1 when succeeded. A bit strange though is that we get some error messages in preproc phase:
    0103 152632 (1726) 2 Collect Event:Allmanna_handlingar < directoryscanner=xml_scan_directory
    0103 152632 (5026) 3 Sender of job set to:
    0103 152632 (1730) 3 preproc message:Allmanna_handlingar < directoryscanner=xml_scan_directory
    0103 152632 (4719) 2 Failed to Base64 decode data.
    0103 152632 (3873) 0 Failed to load LXF overlay: D:\ManagementGateway\5.6.2\root\applications\Kundcenter\Development\fi ler\test-utdata.pdf
    0103 152632 (1731) 2 Doing message:Allmanna_handlingar < directoryscanner=xml_scan_directory

     

    2 weeks ago
  • Therese Lindgren Therese Lindgren
    0 likes

    Can the error messages depend on that the file is created in script before message and is not available in preproc message? I mean that it is ok to get these messages.

    2 weeks ago
Next

 

Latest from the blogs

Read more