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.

Similar Messages

  • Converting xml file with arabic content to pdf using FOP

    Hello all
    I am trying to convert a dynamically generated xml file in which most of the data comes from the oracle database with arabic content, to pdf using FOP. I have used "Windows-1256" encoding for the xml. If i open the xml generated with the internet explorer the arabic content displays properly but the pdf is not generated and the acrobat reader shows the file as corrupted or not supported. Please help me. Its very urgent.
    Thanks & Regards
    Gurpreet Singh

    There is no direct support for importing RTF from an XML extract. Perhaps feature 1514 "Mapping formatted XML data into multiline field" will be of some use. This was released in 11.0, I believe.
    Essentially you can establish paragraph and certain text formatting like bold and underline when you include the proper token information in the data. I believe this is similar to simple HTML tokens.
    Example: &lt;FIELD>&lt;P>First paragraph of data.&lt;/P>&lt;P>New paragraph with &lt;B>&lt;U>bold and underline text&lt;/U>&lt;/B>. Rest of paragraph normal.&lt;/P>&lt;/FIELD>
    The result is something like this:
    <P>First paragraph of data.</P><P>New paragraph with <B><U>bold and underline text</U></B>. Rest of paragraph normal.</P>

  • How do I separate a PDF into multiple PDFs using Adobe PDF Pack?

    How do I separate a pdf into multiple pdfs using AdobePack?
    [Title edited to reflect actual product name... Mod]

    I do not find "AdobePack" when I look at the list of forums https://forums.adobe.com/welcome
    What is the exact name of the program you are using... Acrobat, or are you using the online version at Acrobat.com?
    ADDED... found Adobe PDF Pack (read only) so will move this message

  • Generating a pdf using InDesign CS4

    Hi there
    I am having problems generating a pdf using version CS4 - I have done this hundreds of times but on this occasion after selecting the preset I want, the file begins to generate / export and once the last page is reached - I get the message Adobe InDesign CS4 has stopped working - A problem caused the program to stop working correctly  and so no saved pdf !
    I tried doing the same thing using InDesign CS3 version at home and alas this works!
    I have tried exporting the file to a Interchange file and then attempted to export the file this way but again the same message appears. V frustrating!
    I have used the same exporting / preset for months and never had a problem before.
    Any ideas? The file is quite large in size - around 80mb but not sure this would cause a problem when trying to generate a high res pdf.
    All thoughts / suggestions welcome!
    Thanks

    Sometimes this is caused by insufficient system resources. In such cases exporting in chunks and combining in Acrobat generally will work.
    If that 's not it, it's most ikley an object on a page that is damaged or otherwise non-cooperative. You can isloate the page by trying  to export half at a time, then half of each section that fails. Once you've isolated the page you can do the same withthe objects on the page.

  • After latest update (11.0.10.32), can't generate color PDFs using Word PDFMaker toolbar.  Solution?

    After applying the latest update to Adobe XI Pro, I can no longer generate color PDFs using the Adobe ribbon in Microsoft Word 2010 (Windows 7 operating system).  Other PDF generation methods (for example, Save As Adobe PDF) produce color PDFs just fine, but I need bookmarks as well as color.  Can anyone explain or offer a solution besides uninstalling the current Adobe XI Pro and re-installing the original version?
    Thanks in advance. 

    I’ve found the answer.
    I'm guessing that an Office 2010 update was the problem, or maybe a change in printer drivers?  In Word 2010, I went to Options, Advanced, expanded the Layouts options, and cleared the "Print colors as black on noncolor printers" option. Now I get color PDFs again.  By the way, this must be done for each .docx file. 
    Thanks so much for your patience and help to all who replied.

  • How to generate multiple sheets using xml publisher

    Hi,
    how to generate multiple sheets using xml publisher.
    Thanks,
    Nur

    http://lmgtfy.com/?q=how+to+generate+multiple+sheets+using+xml+publisher

  • Including image in FO fille to generate PDF using FOP

    Hi, we are trying out generating PDF files in JDK1.1.7 environment by using FOP.
    While we are testing we are encountering problem with writing images.
    In .fo file if the image is included, it is giving the following exception.
    We are of no clue regarding this. If any one can help in this regard, please help us out.
    Help of any kind is greatly appreciated.
    Following is the Exception:
    java.lang.UnsatisfiedLinkError: parseImage
    at sun.awt.image.GifImageDecoder.readImage(GifImageDecoder.java:558)
    at sun.awt.image.GifImageDecoder.produceImage(Compiled Code)
    at sun.awt.image.InputStreamImageSource.doFetch(Compiled Code)
    at sun.awt.image.ImageFetcher.fetchloop(Compiled Code)
    at sun.awt.image.ImageFetcher.run(Compiled Code)
    Error while creating area : Error while loading image file:/C:\fop1.4\src\xml_fe
    ather.gif : class java.lang.Exception - Image error
    Hisun.awt.image.URLImageSource
    Regards
    Ramavardhan.

    java.lang.UnsatisfiedLinkError: parseImage
    means that a native library is missing (ie .dll on windows, .so on most unix, .sl on other unix). The default behaviour is to try and load librarys from the CLASSPATH variable, but apps can try to locate them in other ways.
    asjf

  • Arabic pdf using FOP

    hello all ..
    i m able to generate the pdf in arabic format using FOP 0.20.4 but the problem is that the data that comes from database (arabic data in oracle database) is not displayed properly and the direction of the data is not correct. Please help me if someone has tried to generate the arabic pdf.
    thanks in advance
    gurpreet singh

    No i m not using iText. I m using FOP. But if u know
    the solution for iText then please help me as i tried
    to use that too but arabic data is not displayed.
    Gurpreet SinghKaaka, yeh dekho. http://itextdocs.lowagie.com/tutorial/#part3
    There are a number of examples using Unicode and fonts- they might be of some help.
    I am not too familiar with iText, so you may want to ask specific questions over there.
    Here is a link for FOP:
    http://www.javaranch.com/journal/200409/CreatingMultipleLanguagePDFusingApacheFOP.html

  • Automatically generating multiple pdf reports from single(*.rpt) report file

    Post Author: msam
    CA Forum: General
    I would like to be able to automatically pass a parameter list to a single report, and have it automatically generate multiple reports (as saved pdf files), based on the parameter list.
    Is this possible?  If so, could someone point me to some documentation?  Thanks.

    What you probably need to do is generate each bio
    individually with the
    <cfdocument...> tag just the way you want them. And
    then use some of
    the advanced <cfpdf...> functionality that allows you
    to append two or
    more individual PDF's into a single large PDF.
    Here are some resources that describe some of the
    <cfpdf...> functionality.
    http://www.coldfusionjedi.com/index.cfm/2007/7/9/ColdFusion-8-Working-with-PDFs-Part-1
    http://www.coldfusionjedi.com/index.cfm/2007/7/10/ColdFusion-8-Working-with-PDFs-Part-2
    http://cfpdf.blogspot.com/
    http://cfpdf.blogspot.com/2007/06/cfpdf-action-merge_27.html
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=cfpdf_02.html

  • How do I combine multiple PDF using PHP on Linux

    Hi,
    I would like to know if there is an Adobe product that can combine multiple PDF's into a single document and works on Linux? We are developing an application using PHP on Linux that has to combine selected PDF's and would like to know if there is a tool with api's (or command line interface) to allow that.

    Adobe licenses the PDF Library SDK for native developers on Linux platforms (as C code). They do not supply PHP tools.

  • How to generate a PDF using a webservice?

    Hi all,
    I've got the following code in a webservice that generates a PDF:
    // Create a ServletOutputStream object
    ServletOutputStream oOutput = objResponse.getOutputStream();
    // Set the HTTPResponse objects content type
    objResponse.setContentType(objMyOutputContext.getContentType());
    // Get the length of the output stream
    int outLength = objMyOutputContext.getOutputContent().length;
    // Create a byte array and allocate outLength bytes
    byte[] cContent = new byte[outLength];
    // Populate the byte array by invoking getOutputContext
    cContent = objMyOutputContext.getOutputContent();
    // Write a byte stream back to the web browser. Pass the byte array
    oOutput.write(cContent);
    The problem is that I don't know how to pass the HttpServletResponse object (objResponse) to the WebService so I can obtain the ServletOutputStream which is needed to create the PDF form in a web browser. When I pass this object there's an error because this type of parameter is not serializable.
    Can anyone help? Does anyone know how to serialize this object? Is there any other possibility to generate a PDF form using a webservice with a serializable parameter?
    Thanks

    Hi,
    It sounds good, maybe you can get more info at http://www.adobe.com/devnet/
    Good luck and regards

  • BIG Problem with generating multiple pdfs

    Hi,
    I have an application for which the final output is a pdf report about an applicant from a database of applicants.
    If I print the form just once, all the stylesheet formatting is applied correctly.
    If I try to loop through the database and generate multiple reports of multiple applicants, the styles and formatting get applied ONLY to the first report, and then the subsequent reports do not have any styles applied which of course makes them unacceptable.
    I've tried loading the stylesheet before the loop and inside the loop, no difference.
    The styles being lost are for divs and tables and cells.  Fonts are handled separately by calling functions within the report which apply them on the fly.to text based on the section and type of output.
    Is anyone familiar with this problem?  Is there a workaround? I really really really need this to work.
    Thanks,
    RIchard

    I do not know the cause, but if all else fails you could move the cfdocument code to a separate template.  Then the styles seem to work as expected.
        <!--- loop code --->
        <cfloop from="1" to="5" index="x">
              <!--- call separate script cfinclude, cfmodule, etcetera ... --->
              <cfinclude template="test.cfm?x=#x#">
         </cfloop>
         <!--- test.cfm --->
        <cfdocument format="pdf" filename="testpdf-#url.x#.pdf" overwrite="true">
            <div style="background-color: #ff0000;">Test div</div>
        </cfdocument>

  • Word document with multiple sections generates multiple pdf?

    Hello everyone,
    I'm a new and happy Mac user, but not fully able to use this. I hope you can help.
    I have a Word document, with multiple sections that I want to convert into pdf. When I used to do this with the PC, I didn't have problems. I used to use Click to Convert and I normally used to get one single pdf file.
    Now, using the pdf button wit the Mac, I get separate pdf files, one for each section. Is there a way that I can create a single pdf, with all the sections in order? If not, how can I merge the pdf in one single pdf file?
    Thanks in advance.

    Hi,
    just to let you know I have sorted this.
    http://macintoshhowto.com/leopard/how-to-merge-pdf-files-with-preview-in-leopard .html
    Thanks.

  • Output Charts to PDF using FOP

    Does anybody know is it possible to output ones charts to PDF format using the FOP??

    Hello,
    You could use something like the Report to FOP howto and by posting the SVG source get a PDF. I have never done that but in theory it should work.
    I have taken the source by hand and rendered FOP and that works, the only issue was the styles and class's had to be all put into the custom CSS section of the Chart attributes.
    Carl

  • How to generate multiple "gift certificate" pdfs with unique serial #s

    I am a new Acrobat user (have Adobe Acrobat 9 Pro) and poked around a bit to see if I could find out how to do this, but found nothing.
    I assume this has been done before and hope someone can point me in the right direction.
    Here's what I am trying to do:
    1. I currently have a pdf doc with a field for a unique serial # (let's call the doc a "Gift Certificate" for simplicity, though that's not quite what it is).
    2. I want to generate multiple pdf files, say 100 of them, based on this original Gift Certificate, but with each one having a unique serial # in the appropriate field, say starting at ser # 1001, and running through to ser # 1100.
    3. I want to be able to save each of these new files on a hard drive - not outputting them to a printer (though this might come in handy in the future too).
    Is this something I can do in Adobe Acrobat Pro 9?  I looked at the Batch Processing tool, but that didn't seem to have any ability to create new files.
    Or do I need a plug-in?  Or a separate software altogether?
    Any help for this novice would be greatly appreciated.
    Thanks
    keith

    Problem solved.
    Forum member try67 wrote me a script, complete with simple installation instructions.
    It works perfectly right out of the box.  Great stuff!!!
    Wish it always worked that way.
    Keith

Maybe you are looking for

  • XML Parsing Error: duplicate attribute in Firefox

    Hello, I recently switched from a JSF 1.2 RI nightly build from March to the 1.2_01 SNAPSHOT from 5/5/06 available in the maven repository: https://maven-repository.dev.java.net/repository/javax.faces/jars/ Upon doing so, Firefox stopped rendering ce

  • Finding direct and indirect dependency

    Hi, I have table say SAPECC, which is used in one of the procedure as given below : create or procedure test121 as begin insert into sapecc2 select * from sapecc; end; And SAPECC2 is used in another procedure as given below : create or procedure test

  • DB connect with MS SQL

    Hi, We are in BW 3.5 with DB as Oracle and OS AIX. Is it possible to extract data form the the MS SQL server by using DB connect Heard that to extract data from MS SQL,the OS of the BW system should be windows NT Please guide me  Thanks Sarasu

  • Help - my airport won't configure

    Hi I have been using an airport express for a few months now and it has been working fine. Last night it stopped working and I tried to fix it but I think I have made matters worse! It is now telling me that airport is not configured and doesn't even

  • How do I import video from iTunes?

    How can I import video from iTunes to iMovie?