Generating a PDF document within a servlet

I am looking to create a servlet that generates an XML file using the XML SQL utility and then presents the user with a PDF file (report) of the results. I have a style sheet that works with FOP 0.17 and have used the command line to generate a PDF based on this style sheet. I would now like to embed this as an option within a servlet.
I have read the posting about doing this using the XSQL servlet, but I would prefer to write my own servlet and not use the XSQL servlet.
An example code would be extreamly helpful.
Thanks
JG

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by John Gerst ([email protected]):
I am looking to create a servlet that generates an XML file using the XML SQL utility and then presents the user with a PDF file (report) of the results. I have a style sheet that works with FOP 0.17 and have used the command line to generate a PDF based on this style sheet. I would now like to embed this as an option within a servlet.
I have read the posting about doing this using the XSQL servlet, but I would prefer to write my own servlet and not use the XSQL servlet.
An example code would be extreamly helpful.
Thanks
JG<HR></BLOCKQUOTE>
In this case you has to use FOP as standalone procesor, refer to xml.apache.org for details.
Best regards, Marcelo.

Similar Messages

  • R12 : System Failed to generate the PDF Document.

    I am trying to create a PO thru auto create but I hit inquire > View Document , I encountered an error: System Failed to generate the PDF Document. Please contact your system administrator. We just updgrade our instance from 11.5.2.10 to r12.1.2. Any thoughts?
    Thanks,
    Leo

    Please see if these docs help.
    System Fails To Generate PDF Document After Clicking "PDF Document" On Supplier Notification When Different Languages Are Used [ID 1078546.1]
    PO Email From Tools>Communicate At Same Time of Approval Corrupts PDF File Transmits As .HTML & System Failed to Generate PDF [ID 1287488.1]
    Thanks,
    Hussein

  • How to generate a pdf document from excel on ipad version?

    IS there a way to generate a pdf document from an excel file directly from excel ipad version ?

    IS there a way to generate a pdf document from an excel file directly from excel ipad version ?

  • How do you link a pdf. document within a Keynote slide?

    How do you link a pdf. document within a Keynote slide?

    Gary, I'm trying to save a Keynote presentation that was created from a Powerpoint presenation using PDF files.
    It imported beautifully, problem is it won't play. Keeps giving me a "Keynote cannot play your slideshow because an error occured" message.
    I thought it was a Powerpoint/Keynote incompatibility thing, so I recreated the presentation - 1 pdf per slide just like you have here (I did this before finding your post) and it still wouldn't play. I even tried JPG - nothing; just horrible looking images.
    Is there something I'm missing?

  • Automate generating savable PDF document

    I have a following situation: I have a web-application for filling of some documents by online, this application have functionality for generation PDF with form of the filled document. It is necessary for me, that I could generate PDF files with saved forms for filling by offline with further sending on server of my application. Besides, when I try to distribute this PDF file by Acrobat Pro, I receive forms at which there is a button of form sending by e-mail. Even if I created the sending button by URL, it is all the same substituted on sending by e-mail. Therefore I wish to learn, whether probably to realise the following:
    1) Creation saved PDF files with forms software. (I have known only about creation XDP of files and their conversion in saved PDF by means of Reader Extension).
    2) If the first variant is not realised, I want to known about possibility of usage "Distribute form" Acrobat Pro for creation saved PDF files without change existing "Submit" sending buttons by URL.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by John Gerst ([email protected]):
    I am looking to create a servlet that generates an XML file using the XML SQL utility and then presents the user with a PDF file (report) of the results. I have a style sheet that works with FOP 0.17 and have used the command line to generate a PDF based on this style sheet. I would now like to embed this as an option within a servlet.
    I have read the posting about doing this using the XSQL servlet, but I would prefer to write my own servlet and not use the XSQL servlet.
    An example code would be extreamly helpful.
    Thanks
    JG<HR></BLOCKQUOTE>
    In this case you has to use FOP as standalone procesor, refer to xml.apache.org for details.
    Best regards, Marcelo.

  • How to generate a PDF document from ABAP program

    Hi experts,
    I have arequirement where in i need to create a PDF document using program. I have all the data collected into tables and i have used the calss CL_FP_PDF_OBJECT.
    A pdf document is successfully created, but unable to open it because of some error. I guess some encryption is missing.
    As an alternative I have created a smartform and generated its OTF data in my program and created a PDF. This is working fine.
    But as per my requirement, i cannot go for a smart form.
    Any help to resolve this issue will be highly appreciated.
    Thanks & regards,
    Asrar Ahamed MA
    Infosys Tech. Ltd. INDIA

    Hi Asrar ,
    create a report with this Copy and give your program name in the selection screen whose output need to be in PDF.
    *report  zanusha_spool_to_pdf.
    ---TABLES----
    tables:
      tsp01.
    ---STRUCTURES---
    data:
      mstr_print_parms like pri_params,
      mc_valid(1)      type c,
      mi_bytecount     type i,
      mi_length        type i,
      mi_rqident       like tsp01-rqident.
    ---INTERNAL TABLES---
    data:
      mtab_pdf    like tline occurs 0 with header line,
      mc_filename like rlgrap-filename.
    ---SELECTION SCREEN---
    parameters:
      p_repid like sy-repid, " Report to execute
      p_linsz like sy-linsz default 132, " Line size
      p_paart like sy-paart default 'X_65_132'.  " Paper Format
    start-of-selection.
      concatenate 'c:\'
                  p_repid
                  '.pdf'
        into mc_filename.
    *-- Explicitly set line width, and output format so that
    *-- the PDF conversion comes out OK
      mstr_print_parms-linsz = p_linsz.
      mstr_print_parms-paart = p_paart.
    *-- Make sure that a printer destination has been set up.
    *-- If this is not done the PDF function module ABENDS
      if mstr_print_parms-pdest = space.
        mstr_print_parms-pdest = 'LOCL'.
      endif.
    *-- Setup the Print Parmaters
      call function 'GET_PRINT_PARAMETERS'
        exporting
         authority              = space
          copies                 = '1'
         cover_page             = space
         data_set               = space
         department             = space
         destination            = space
          expiration             = '1'
         immediately            = space
         in_archive_parameters  = space
         in_parameters          = space
         layout                 = space
         mode                   = space
          new_list_id            = 'X'
          no_dialog              = 'X'
          user                   = sy-uname
        importing
          out_parameters         = mstr_print_parms
          valid                  = mc_valid
        exceptions
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          others                 = 4.
      submit (p_repid) to sap-spool without spool dynpro
                       spool parameters mstr_print_parms
                       via selection-screen
                       and return.
    *-- Find out the spool number
      perform get_spool_number using sy-repid
                 sy-uname
        changing mi_rqident.
    *-- Convert Spool to PDF
      call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
        exporting
          src_spoolid              = mi_rqident
          no_dialog                = space
          dst_device               = mstr_print_parms-pdest
        importing
          pdf_bytecount            = mi_bytecount
        tables
          pdf                      = mtab_pdf
        exceptions
          err_no_abap_spooljob     = 1
          err_no_spooljob          = 2
          err_no_permission        = 3
          err_conv_not_possible    = 4
          err_bad_destdevice       = 5
          user_cancelled           = 6
          err_spoolerror           = 7
          err_temseerror           = 8
          err_btcjob_open_failed   = 9
          err_btcjob_submit_failed = 10
          err_btcjob_close_failed  = 11
          others                   = 12.
    *-- Download the file
      call function 'DOWNLOAD'
        exporting
          bin_filesize = mi_bytecount
          filename     = mc_filename
          filetype     = 'BIN'
        importing
          act_filename = mc_filename
        tables
          data_tab     = mtab_pdf.
          FORM get_spool_number *
          Get the most recent spool created by user/report              *
    -->  F_REPID               *
    -->  F_UNAME               *
    -->  F_RQIDENT             *
    form get_spool_number using f_repid
         f_uname
                    changing f_rqident.
      data:
        lc_rq2name like tsp01-rq2name.
      concatenate f_repid+0(9)
                  f_uname+0(3)
        into lc_rq2name.
      select * from tsp01 where  rq2name = lc_rq2name
      order by rqcretime descending.
        f_rqident = tsp01-rqident.
        exit.
      endselect.
      if sy-subrc ne 0.
        clear f_rqident.
      endif.
    endform." get_spool_number
    Thanx
    Anusha.

  • Printing a PDF document within a postscript file

    I know it is possible to print a PDF document from within a postscript file using Document Structuring Comments and Document Comment Extensions.  Is is possible to print a single page PDF document multiple times as a booklet?  For example I have a PDF document that is a page of graph paper.  I want to print this PDF file 8 times in the form of a booklet.  Is this possible and if it is how would I code the postscript to do this?
    Thank you  in advance
    David

    Where do you know that “it is possible to print a PDF document from withint a PostScript file using Document Structuring Comments and Document Comment Extensions” from?
    PDF is absolutely not part of the PostScript language itself. Nor is there anything in the DSC specifications that provides for printing a PDF document from within a PostScript file.
    Attached to this posting are the two existing pieces of documentation of DSC from Adobe. Neither references such a capability.
    DSC are simply “comments” within a PostScript program file which may be used by preprocessing software or external applications for various puposes, especially associated with prepress actions and placing of EPS (Encapsulated PostScript) in other graphic arts documents.
    Conceivably some implementor of some PostScript product may have provided some capability to embed a PDF file or to invoke the printing of a PDF file from within a PostScript file using custom DSC. However, this is certainly not part of the official PostScript language. I have also attached those specifications as well!
              - Dov

  • Can you specify ink trapping for a PDF document within Acrobat Professional, after a PDF has been cr

    (File > Properties > Advanced > Trapped)
    In other words, does this specification really change the ink trapping of the PDF, or does it just change a document information metadata tag?
    Or, does ink trapping have to be specified when the PDF is created, in the application that creates the PDF?

    Your assumption is correct. That field entry will not affect or perform trapping.
    Trapping does not have to be performed by the authoring program. Better results are obtained via the RIP/software/system processing the image data.

  • Problem with generate a PDF document

    Hi guys, i have a huge problem. i develop the basic examples from "Using Interactive Forms"
    (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d) and
    always been returned the follow error:
    com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.base.core.PDFDocumentRuntimeException: Severe : PDFDocument is NULL. Exception : Service call exception; nested exception is: java.net.SocketTimeoutException: Read timed out
    I have installed ACF on my computer (for NW04s), Adobe Reader and Designer 7.0, SAP NetWeaver Developer Studio Version 2.0.12 Build id: 200505090134. In addition, i have the user ADSUser configurated.
    I make a test of ASDUser and send me this result:
    HTTP/1.1 200 OK
    Connection: close
    Set-Cookie: <value is hidden>
    Set-Cookie: <value is hidden>
    Server: SAP J2EE Engine/7.00
    Content-Type: text/xml; charset=UTF-8
    Date: Tue, 31 Oct 2006 20:40:12 GMT
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
    <SOAP-ENV:Body>
    <rpl:rpDataResponse xmlns:rpl='urn:AdobeDocumentServicesVi'>
    <rpl:Response xmlns:pns='urn:com.adobe'>
    <pns:rpStrings>
    <pns:RpString>
         <pns:name>TraceString</pns:name>
         <pns:value>Begin trace Required stream: "PDFDocument" not found.</pns:value>
    </pns:RpString>
    <pns:RpString>
         <pns:name>Error_Level</pns:name>
         <pns:value>0</pns:value>
    </pns:RpString>
    <pns:RpString>
         <pns:name>Results</pns:name>
         <pns:value></pns:value>
    </pns:RpString>
    <pns:RpString>
         <pns:name>VersionInfo</pns:name>
         <pns:value>705.20051005114147.242570</pns:value>
    </pns:RpString>
    </pns:rpStrings>
    </rpl:Response>
    </rpl:rpDataResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    it's ok?

    Hi,
    What do you mean with the "ADS and the J2EE are at in the same level"?
    Questions:
    1) I did two test with the se38 transaction (program FP_TEST_00, print preview, printer LP01 and ZLOC)..the result was a error with code 100101 and no response...this test works for webdynpro for java enviroment?
    2)I check the conection with the sm59 transaction and send this result:
    ~response_line     HTTP/1.1 200 OK
    ~server_protocol     HTTP/1.1
    ~status_code     200
    ~status_reason     OK
    connection     close
    server     SAP J2EE Engine/7.00
    set-cookie     saplb_*=(sap-dev-6_DEK_50)504285650; Version=1; Path=/
    content-type     text/html;charset=ISO-8859-1
    date     Thu, 02 Nov 2006 15:44:40 GMT
    set-cookie     JSESSIONID=(sap-dev-6_DEK_50)ID0820220750DB00609035612061678364End; Version=1; Path=/
    This is ok, i guest?
    3) To make a test for ADSUser, the result not display this message (i see in a some post):
    "IIOP service is running"
    some relation????
    Thanks.

  • Generating password protected pdf document -PLSQL

    Experts,
    Can please anyone to share the code how to do password protect the pdf which is located in unix directory.

    Google gave me below links :
    http://technology.amis.nl/2012/04/11/generating-a-pdf-document-with-some-plsql-as_pdf_mini-as_pdf3/
    PL/PDF generate and manipulate PDF with Oracle PL/SQL
    https://community.oracle.com/thread/2419241?tstart=0
    Regards
    Girish Sharma

  • Creating link to excel document within PDF portfolio

    i created a pdf portfolio and created links to pdf documents within portfolio but am unable to create a link to the excel documents.  I can't even create a link to direct them to a specific folder where the item is held.  HELP, New to pdf portfolio's!

    One option is to create a PDF from the Excel spreadsheet and link to that.
    If you want to update the spreadsheet, you could create a Web Content overlay (or HTML article) that links to a Google spreadsheet. I've played around with linking to a Google presentation, and it works fine. You can update the spreadsheet/presentation on the website and the changes automatically appear in the overlay. I've just dabbled at it, so I wouldn't be much help with sizing/formatting issues.

  • JSP to Generate PDF Document

    Hi,
    I am developing a jsp system that needs to generate a pdf document for every page before proceding to the next on the click of a button.
    What i have now is itext but itext is a time taker! i have to literally code every page and extract values from my classes.
    What i would like is if there was such an api that could auto generate the jsp page into pdf since all the values will be there when the user clicks to procede to the next page.
    Would really appreciate help!!
    Thanks,
    Dev

    Try to find out more about Filters usage.
    It's a kind of wrapper that get executed when a user request a resources(page for instance) before the file(specified in form action) takes control, this is used to carry out common process to a group of pages without coding each piece of code in each page,
    AND when a response is send back, this same Filter get control to include or modified current response to client.
    I think that in order to parse the response and generate .pdf files(if the pdf for current page does not exist) you should write the html response in xml format. or at least you should use a component like JTidy that builds an XHTML-compliant page from a non-xhtml compliant page.
    In Filter implementation you should parse the response and transform it using Formatting Object Processor such as FOP or XING, or anyother
    Hope this help as starting point
    Regards
    OO

  • Can I generate pdf document that has Acrojs functionality with the sdk?

    Hi, I was wondering if I can create a pdf document with Acrojs functionality in it from the sdk. I'm looking to see if I can create an application in C# that generates a pdf document with a form scripted with Acrojs. Is this possible? Thank you guys for your attention.

    >Until now, I could see the TOC on my PDF.
    Nothing has changed.
    Remember, iBA is not a PDF authoring tool.

  • Rendering pdf document properly in JSP

    I am currently working on a Portal project, which requires generating a PDF file and passing this to a JSP file providing an option to the user to either view the PDF file or download and save it. I've accomplished the first part of file creation (I am using iText for generating the pdf document), but I�m unable to send the file from server to the client side (ie to the browser).
    The code
    response.setContentType("application/pdf");
    response.setHeader("Content-Disposition", "inline; filename=file.pdf");
    which works perfectly fine when used as a standalone to popup an PDF file in tomcat server but fails to accomplish to render the outputstream properly(the stream is rendered in the JSP page improperly as text instead of associating with the application for reading pdf document�s) in the Portal Server Environment. Can anyone throw some light into this problem?

    The code is in JSP.
    What is the difference in putting the code in JSP or servlet.
    How is it working in standalone mode in tomcat application server.

  • Generate multiple PDFs using FOP

    Hello,
    please take a look to the following code snipplet it is intended for the generation of a PDF document. The PDF-content is written to an OutputStream which works quite well.
    The problem is that I want to append some more PDF content to the OutpuStream, but these seams to be impossible. Is there anybody who merged several PDF-Streams to one "big OutputStream" ?
    try
    driver.setOutputStream(pdf);
    //Setup XSLT
    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer(new StreamSource(xslt));
    //Setup input for XSLT transformation
    Source src = new StreamSource(xml);
    //Resulting SAX events (the generated FO) must be piped through to FOP
    Result res = new SAXResult(driver.getContentHandler());
    //Start XSLT transformation and FOP processing
    transformer.transform(src, res);
    System.out.println("first transformation...");
    finally
    pdf.close();
    }

    Hang on, your thread title suggests you want to generate multiple PDF documents from a single xml source, but the text is talking about combining pdf content.
    I'm not sure which one you really want so I'll the first one.
    I've recently had to generate multiple pdf documents from a single xml source. I used the following (hoping the tags render okay):
                   <xsl:result-document href="{$filename}" format="html">
                        <!-- document root here -->
                        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
                             <xsl:call-template name="masterSet"/>
                             <!-- Apply the ID template to this instance of the ID element -->
                             <xsl:apply-templates select="."/>
                        </fo:root>
                   </xsl:result-document>I used the Saxon engine to split the xml into multiple .fo documents and then ran FOP over each of these.
    The 'xsl:result-document href="{$filename}" format="html"' element does the splitting. Obviously, the filename variable defines the path to the outpute file. You'll no doubt define that within some kind of for-each loop.

Maybe you are looking for

  • Wi-Fi Printer says it is ONLINE. computer says it is OFFLINE.

    HP Photosmart 110a.  Have been using it for more then a year when it stopped responding to pring requests and I get an error message saying: Printer is OFFLINE.  When I conduct a Wi-Fi directly on the printer, it says I am connected to kmy network an

  • Word 2010 with excel links is very slow

    Hi.. One of our groups uses an word file that has many excel links in it. Ever since we upgraded to office 2010 .docx format the word doc takes forever to open, it seems to get hung on the excel links and it keeps retrying these links until it fails.

  • How to make copies/duplicates of photos in LR4 - NOT Virtual Copies

    Can someone tell me if there is a SIMPLE way to make a copy or duplicate of a photo in LR4. In otherwords, you have a photo image in one folder and you want to make a copy and move it to another folder or subfolder and that copy is identical in EVERY

  • How to park invoice ( Incoming Idoc )

    Hi, I have a requiremnt where i need to park the incoming idoc(INVOIC01). I am using the standard program "IDOC_INPUT_INVOIC_MRM". I made the copy of this FM into a Z Function Module and using "MRM_CREATE_INVOICE" passing RBSTAT_NEW = 'A' which is fo

  • [OBIEE 10.3] kuiFormulaBlockingScript

    Hi, On page 58 of the Presentation Services Administration Guide there is an example of blocking a request based on a formula. But I can't get it to work against paint. Did anybody get this working? John