Need to Merge an Adobe XML file with a normal PDF
The problem...
I have created an order form in Adobe LiveCycle Designer (pre-ES). The customer's requirements force us to merge their purchase order (a flat standard PDF) with the order form I have created to get the complete PDF to bill with. Previously we were using a form created in another software and printing to PDF to merge the 2 PDF files. The thought process with creating a form in LiveCycle Designer was "Oh 2 PDF's we can just merge them" ... we were very WRONG. And please don't suggest "Packaging" the files... it won't work for our processing system... we've already tried .
What we know now (had we known it before we'd have never purchased the licensing for LiveCycle Designer to start with)...
You can NOT merge a PDF that has XML in it with Adobe Proffesional.
Temporary Solution...
We know we can print to PDF and then merge the files... this gets us the result we need, but it takes longer to print to PDF from these XML files than it did from the previous versions of the order forms in created in other software.
Is there another solution?
Plea for help! The users that are forced to do the process of printing to file and merging are ready to riot and/or go back to the "other" software.
Hello!
There are a couple terms you can google:
"PDF Concatenate Forms iText"
"Merge XML data with PDF Forms"
Concatenating PDFs means you join multiple forms together into one PDF.
Did you need to merge, or concatenate the forms?
Either way there are a couple of methods to do this programmably.
iTextSharp (.NET)
iText (Java)
FDFToolkit.net (.NET)
iText products are open source, and have a learning curve, and support is provided on a Open mailing list.
iText products are free ($) but can cost you time and money to research the methods.
Useful Links:
http://www.fdftoolkit.net/
Message was edited by: NKOWA
Similar Messages
-
Need to generate a Index xml file for corresponding Report PDF file.
Need to generate a Index xml file for corresponding Report PDF file.
Currently in fusion we are generating a pdf file using given Rtf template and dataModal source through Ess BIPJobType.xml .
This is generating pdf successfully.
As per requirement from Oracle GSI team, they need index xml file of corresponding generated pdf file for their own business scenario.
Please see the following attached sample file .
PDf file : https://kix.oraclecorp.com/KIX/uploads1/Jan-2013/354962/docs/BPA_Print_Trx-_output.pdf
Index file : https://kix.oraclecorp.com/KIX/uploads1/Jan-2013/354962/docs/o39861053.out.idx.txt
In R12 ,
We are doing this through java API call to FOProcessor and build the pdf. Here is sample snapshot :
xmlStream = PrintInvoiceThread.generateXML(pCpContext, logFile, outFile, dbCon, list, aLog, debugFlag);
OADocumentProcessor docProc = new OADocumentProcessor(xmlStream, tmpDir);
docProc.process();
PrintInvoiceThread :
out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
out.print("<xapi:requestset ");
out.println("<xapi:filesystem output=\"" + outFile.getFileName() + "\"/>");
out.println("<xapi:indexfile output=\"" + outFile.getFileName() + ".idx\">");
out.println(" <totalpages>${VAR_TOTAL_PAGES}</totalpages>");
out.println(" <totaldocuments>${VAR_TOTAL_DOCS}</totaldocuments>");
out.println("</xapi:indexfile>");
out.println("<xapi:document output-type=\"pdf\">");
out.println("<xapi:customcontents>");
XMLDocument idxDoc = new XMLDocument();
idxDoc.setEncoding("UTF-8");
((XMLElement)(generator.buildIndexItems(idxDoc, am, row)).getDocumentElement()).print(out);
idxDoc = null;
out.println("</xapi:customcontents>");
In r12 we have a privilege to use page number variable through oracle.apps.xdo.batch.ControlFile
public static final String VAR_BEGIN_PAGE = "${VAR_BEGIN_PAGE}";
public static final String VAR_END_PAGE = "${VAR_END_PAGE}";
public static final String VAR_TOTAL_DOCS = "${VAR_TOTAL_DOCS}";
public static final String VAR_TOTAL_PAGES = "${VAR_TOTAL_PAGES}";
Is there any similar java library which do the same thing in fusion .
Note: I checked in the BIP doc http://docs.oracle.com/cd/E21764_01/bi.1111/e18863/javaapis.htm#CIHHDDEH
Section 7.11.3.2 Invoking Processors with InputStream .
But this is not helping much to me. Is there any other document/view-let which covers these thing .
Appreciate any help/suggestions.
-anjani prasad
I have attached these java file in kixs : https://kix.oraclecorp.com/KIX/display.php?labelId=3755&articleId=354962
PrintInvoiceThread
InvoiceXmlBuilder
Control.javaYou can find the steps here.
http://weblogic-wonders.com/weblogic/2009/11/29/plan-xml-usage-for-message-driven-bean/
http://weblogic-wonders.com/weblogic/2009/12/16/invalidation-interval-secs/ -
1 xml file to multiple xml files with 200 records in each
Hello Experts,
I have below scenario.
Please suggest me which might be the best approch to work on.
1) XML file to XML file
I will have 1 pretty huge XML file which i need to break in multiple XML files with 200 records each.
1) first approch i can have bpm in which i can split the file according to my requirement.
2) Second approch i can create 2 scenarios in which 1st scenario will pick up XML file and create multiple flat files with File content conversion. Second scenario will pick up all these flat files and create XML files.
2) XML file to XML file
Or i can have multiple files with 1 record per file and i need to merge in multiple XML files with 200 records in each.
So its kind of 1:N or M:N scenarios.
Please tell me which is might be better performance and design wise.
Or if you have any idea in any other way i can do this, then please reply as soon as possbile.
Please tell me if you have OS command for the same or some script to run or anything which i can implement.
Thanks,
Hetalwhat is your senario? is it File to File?
You can use multi mapping concept without BPM. You can handle the 200 records per message logic in the multimapping.
Regards,
Praveen Gujjeti. -
Merging web-services.xml files
Good day,
Is there an easier way to merge a custom web-services.xml file with the
one generated by servicegen? It makes it very difficult to have a clean
build when you have to go in and edit the web-services.xml to add your
own types.
Thanks,
SeanThis is no good tool to merge web-services.xml.
You can run servicegen once and get the web-services.xml file, then modify
it as you need.
In your automatic build process, run autotype, then use wspackag to package
your customized web-services.xml.
Thanks,
-Neal
"Sean Garagan" <[email protected]> wrote in message
news:[email protected]..
Good day,
Is there an easier way to merge a custom web-services.xml file with the
one generated by servicegen? It makes it very difficult to have a clean
build when you have to go in and edit the web-services.xml to add your
own types.
Thanks,
Sean -
How can I save a XML file with JAXP1.1?
Dear All.
I write a program to create XML file with DOM model, but I can't know how to save it? My environment is JAXP1.1 and JDK1.3.1,I has been required not use other XML parser toolkits,only JAXP1.1.
How can I do? thank you.
Many person give me a idea the com.sun.xml.tree.XmlDocument, but I can't find the class in API document or JAXP1.1's packages. why?
what is it? How can i use it?
thank you very much.The way to save an XML Document is using a Transformer.
To have access to a transformer use the packages :
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
Then for saving your Document Object (named dXml) get a Transformer Object with the TransformerFactory Object :
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer();
Now you have got your Transformer Object, to save your Document Object use the method :
Document dXml = getMyDocument(); // this is your Document Object.
OutputStream osSave = getMySaveStream(); // this the OutputStream you need to save your Document.
try
t.transform(new DomSource(dXml), new StreamResult(new OutputStreamWriter(osSave)));
finally
osSave.close();
And your Document was now saved. -
Create XML file with worksheet's dynamically assigned through XSLT
Hi all
I have a requirement to create a xml file with worksheets dynamically created based on a field value in the internal table .
I have all my values in internal table, and am calling the transformation from bsp application.
Say the internal table has field dataxyz, for every change in value in this field dataxyz i need to create separate worksheet and populate that sheet with some corresponding values .
please guide me how to create worksheet dynamically.
thanks in advance.
Bharathy
Edited by: elam.bharathy on May 16, 2011 6:51 AMCan you use a schema when we compose XML doc from Database tables?
Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me. -
Create xml file with values from context
Hi experts!
I am trying to implement a WD application that will have some input fields, the value of those input fields will be used to create an xml file with a certain format and then sent to a certain application.
Apart from this i want to read an xml file back from the application and then fill some other context nodes with values from the xml file.
Is there any standard used code to do this??
If not how can i do this???
Thanx in advance!!!
P.S. Points will be rewarded to all usefull answers.
Edited by: Armin Reichert on Jun 30, 2008 6:12 PM
Please stop this P.S. nonsense!Hi,
you need to create three util class for that:-
XMLHandler
XMLParser
XMLBuilder
for example in my XML two tag item will be there e.g. Title and Organizer,and from ur WebDynpro view you need to pass value for the XML tag.
And u need to call buildXML()function of builder class to generate XML, in that i have passed bean object to get the values of tags. you need to set the value in bean from the view ui context.
Code for XMLBuilder:-
Created on Apr 4, 2006
Author-Anish
This class is to created for having function for to build XML
and to get EncodedXML
and to get formated date
package com.idb.events.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.idb.events.Event;
public class XMLBuilder {
This attribute represents the XML version
private static final double VERSION_NUMBER = 1.0;
This attribute represents the encoding
private static final String ENCODING_TYPE = "UTF-16";
/*Begin of Function to buildXML
return: String
input: Event
public String buildXML(Event event) {
StringBuffer xmlBuilder = new StringBuffer("<?xml version=\"");
xmlBuilder.append(VERSION_NUMBER);
xmlBuilder.append("\" encoding=\"");
xmlBuilder.append(ENCODING_TYPE);
xmlBuilder.append("\" ?>");
xmlBuilder.append("<event>");
xmlBuilder.append(getEncodedXML(event.getTitle(), "title"));
xmlBuilder.append(getEncodedXML(event.getOrganizer(), "organizer"));
xmlBuilder.append("</event>");
return xmlBuilder.toString();
/End of Function to buildXML/
/*Begin of Function to get EncodedXML
return: String
input: String,String
public String getEncodedXML(String xmlString, String tag) {
StringBuffer begin = new StringBuffer("");
if ((tag != null) || (!tag.equalsIgnoreCase("null"))) {
begin.append("<").append(tag).append(">");
begin.append("<![CDATA[");
begin.append(xmlString).append("]]>").append("</").append(
tag).append(
">");
return begin.toString();
/End of Function to get EncodedXML/
/*Begin of Function to get formated date
return: String
input: Date
private final String formatDate(Date inputDateStr) {
String date;
try {
SimpleDateFormat simpleDateFormat =
new SimpleDateFormat("yyyy-MM-dd");
date = simpleDateFormat.format(inputDateStr);
} catch (Exception e) {
return "";
return date;
/End of Function to get formated date/
Code for XMLParser:-
Created on Apr 12, 2006
Author-Anish
This is a parser class
package com.idb.events.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import com.idb.events.Event;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
public class XMLParser {
Enables namespace functionality in parser
private final boolean isNameSpaceAware = true;
Enables validation in parser
private final boolean isValidating = true;
The SAX parser used to parse the xml
private SAXParser parser;
The XML reader used by the SAX parser
private XMLReader reader;
This method creates the parser to parse the user details xml.
private void createParser()
throws SAXException, ParserConfigurationException {
// Create a JAXP SAXParserFactory and configure it
SAXParserFactory saxFactory = SAXParserFactory.newInstance();
saxFactory.setNamespaceAware(isNameSpaceAware);
saxFactory.setValidating(isValidating);
// Create a JAXP SAXParser
parser = saxFactory.newSAXParser();
// Get the encapsulated SAX XMLReader
reader = parser.getXMLReader();
// Set the ErrorHandler
This method is used to collect the user details.
public Event getEvent(
String newsXML,
XMLHandler xmlHandler,
IWDMessageManager mgr)
throws SAXException, ParserConfigurationException, IOException {
//create the parser, if not already done
if (parser == null) {
this.createParser();
//set the parser handler to extract the
reader.setErrorHandler(xmlHandler);
reader.setContentHandler(xmlHandler);
InputSource source =
new InputSource(new ByteArrayInputStream(newsXML.getBytes()));
reader.parse(source);
//return the results of the parse
return xmlHandler.getEvent(mgr);
Code for XMLHandler:-
Created on Apr 12, 2006
Author-Anish
This is a parser class
package com.idb.events.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import com.idb.events.Event;
Created on Apr 12, 2006
Author-Anish
*This handler class is created to have constant value for variables and function for get events,
character values for bean variable,
parsing thr date ......etc
package com.idb.events.util;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
import java.util.*;
import com.idb.events.Event;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
public class XMLHandler extends DefaultHandler {
private static final String TITLE = "title";
private static final String ORGANIZER = "organizer";
IWDMessageManager manager;
private Event events;
private String tagName;
public void setManager(IWDMessageManager mgr) {
manager = mgr;
This function is created to get events
public Event getEvent(IWDMessageManager mgr) {
manager = mgr;
return this.events;
This function is created to get character for setting values through event's bean setter method
public void characters(char[] charArray, int startVal, int length)
throws SAXException {
String tagValue = new String(charArray, startVal, length);
if (TITLE.equals(this.tagName)) {
this.events.setTitle(tagValue);
if (ORGANIZER.equals(this.tagName)) {
String orgName = tagValue;
try {
orgName = getOrgName(orgName);
} catch (Exception ex) {
this.events.setOrganizer(orgName);
This function is created to parse boolean.
private final boolean parseBoolean(String inputBooleanStr) {
boolean b;
if (inputBooleanStr.equals("true")) {
b = true;
} else {
b = false;
return b;
This function is used to call the super constructor.
public void endElement(String uri, String localName, String qName)
throws SAXException {
super.endElement(uri, localName, qName);
/* (non-Javadoc)
@see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
This function is used to call the super constructor.
public void fatalError(SAXParseException e) throws SAXException {
super.fatalError(e);
This function is created to set the elements base on the tag name.
public void startElement(
String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException {
this.tagName = localName;
if (ROOT.equals(tagName)) {
this.events = new Event();
public static void main(String a[]) {
String cntry = "Nigeria";
XMLHandler xml = new XMLHandler();
ArrayList engList = new ArrayList();
engList = xml.getCountries();
ArrayList arList = xml.getArabicCountries();
int engIndex = engList.indexOf(cntry);
System.out.println("engIndex :: " + engIndex);
String arCntryName = (String) arList.get(engIndex);
System.out.println(
">>>>>>>>>>>>>>>>>>>>" + xml.getArabicCountryName(cntry));
Hope that may help you.
If need any help , you are most welcome.
Regards,
Deepak -
Loading xml file with multiple rows
I am loading data from xml files using xsl for transformation. I have created xsl's and loaded some of the data. In an xml file with multiple row, it's only loading one (the first) row. Any idea how I can get it to read and load all the records in the file???
Could some please help me with the above. I desparately need to move forward.
-
Hi,
I have an xml file with embedded xsl link like below :
XML :
<pre><nowiki><?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="http://abc.com/x.xsl"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
</catalog></nowiki></pre>
When opening xml file on IE, opera, safary ... it works ok. But when opening it on FireFox, i have an error like :
Error loading stylesheet: An unknown error has occurred (805303f4)
http://abc.com/x.xsl
How could i solve this problem ?A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
The helpers at that forum are more knowledgeable about web development issues.
You need to register at the mozillaZine forum site in order to post at that forum.
See http://forums.mozillazine.org/viewforum.php?f=25 -
How do you display xml file with xlst sheet in jsp
I have an xml file with accompanying xslt file (and several images that are used in a single directory. If I doubleclick on the xml file, it displays perfectly in my browser - Formatting, images and all!
The 100 dollar question - How do I duplicate this behavior in a JSP page in WebLogic 8.1 using the code in the xml and the accompanying xslt (formatting) file? I tried simple embedding the xml code in the jsp, but that didn't seem to work. What is the secret?
Okay, I need to add a bit more information here. I understand that it is really easy to just redirect to the XML file. The issue is really security. I want the XML to be inside a jsp that will only allow validated users to view it.
Another way to look at the problem would be, can I add a jsp security tag to the xml file? Or how to I add the xml code inside a jsp and keep the path references to the xslt and graphics.
Hope the added information helps
Thanks,
Ken
Message was edited by: KLee - 20050609 10:25 MST
[email protected]This proved out to be the answer. Thanks for the direction!
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class XML_XSLT_Servlet extends HttpServlet {
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
String xmlfile = req.getParameter("xmlfile"); if (xmlfile==null) xmlfile = "test.xml";
String xsltfile = req.getParameter("xsltfile"); if (xsltfile==null) xsltfile = "test.xslt";
/* Test if file exists!, or use default file */
File f1 = new File(getServletContext().getRealPath("WEB-INF/displayfiles/"), xmlfile);
File f2 = new File(getServletContext().getRealPath("WEB-INF/displayfiles/"), xsltfile);
if (f1.exists() && f2.exists()) {
// System.out.println("Files Found");
} else {
System.out.println("XML and XSLT Files NOT Found");
System.out.println(f1.getPath());
System.out.println(f1.getName());
xmlfile = "test.xml";
xsltfile = "test.xslt";
InputStream fileXML = getServletContext().getResourceAsStream("WEB-INF/displayfiles/" + xmlfile);
InputStream fileXSLT = getServletContext().getResourceAsStream("WEB-INF/displayfiles/" + xsltfile);
OutputStream os = res.getOutputStream();
TransformerFactory xFactory = TransformerFactory.newInstance();
StreamSource stylesheet = new StreamSource(fileXSLT);
Transformer xformer = null;
try {
xformer = xFactory.newTransformer(stylesheet);
} catch (TransformerConfigurationException tfce) {
tfce.printStackTrace();
StreamSource input = new StreamSource(fileXML);
StreamResult output = null;
try {
output = new StreamResult(os);
} catch (Exception e) {
e.printStackTrace();
try {
xformer.transform(input, output);
} catch (TransformerException xfe) {
xfe.printStackTrace();
<pre></pre><pre></pre> -
One to many xml files with file adaptor
Hi,
I have a scenario HCM-ABAPProxy--XI-File for one structure I need to generate multiple xml files with 100 records per file.
this is my input messag
MT_in
Node
PositionIDs
descrption
job
IsActive
what I was doing on the ABAP side for every node I have 100 PositionID's sub nodes. so each node should be a sperate file.
my output structure is
PositionIDs
PositionID
pid
description
job
so there should be one PositionIDs per file which contains 100 PositionID.
I've multi message mapping without BPM that did not work out just wondering if any one came across the same scenario.
thanks,
JoeYou can not create multiple files without BPM. You can pretty much perform multi mapping to achieve your split but to write it to a file, you will have to call the file adapter for each split which you can not do without using BPM. In BPM, for each split that you perform, you can use a send step in for-each loop which will give you the functionality you require.
Award if helpful,
Sarath. -
Example of xml file with connection pool SAP
Hi Everyone
I need a .xml file with pool connection SAP to run on weblogic 8.1.
Where do I get it?
ThanksStefan
Whether your XML is stored using structured storage or not is determined by the way your initially register the schema, not by the way the XML is delivered into the database. Even when performing, for example, and INSERT using a CLOB value, this CLOB will be 'shredded' into the structured storage tables if you have created them appropriately. If not, it will be stored as a simple CLOB.
Allan -
Sending XML Files with Certificate
Hello everybody.
I need develop an abap program for sending XML files with a certificate.
How I can create this certificate?
Somebody have an idea?
Thank you everybody.
NelsonMikael,
This sounds like one of the many quirks (perhaps bugs) related to how FrameMaker handles non-FM files in books. The current book model doesn't play well with XML files as chapters and this seems like yet another problem. Apparently, if an xref does not target another .fm file in the book, Frame assumes that the target file is not in the book and therefore will not be in the book PDF.
There have been discussions here about this in the past. The solution that I use is to run an API client before publishing that converts all XML files to .fm files, and redirect all xrefs appropriately. Then, book features work as expected and PDFs come out as normal. This is not feasible, however, without the automation from the API client.
There may be some who would say that the best approach is to use XML and books the way that the designers did account for... that is, the whole book becomes an XML document with entity references to the separate chapters. In my work, though, this model was not appropriate... rather, I needed a binary FM book to act like a book, except with XML files as chapters. So, I think I understand your situation.
Is API programming or FrameScript an option for you? I think it may be the only way to get what you are looking for.
Russ -
Hi,
I would like to know if its possible to insert or update
existing data of a XML file with flash?
And how can I do it?This code have two procedures or functions the createXML is
called first this one asks for the variable send using get called
fileName (Append this variable to the page request). The function
called writeToFile opens the file and writes to it.
Form flash you need to create the xmlfile and call the
sendAndLoad method. -
Looking for help with actionscript.....
1/ Have ComboBox on stage with prices say $5 to $10 - $10 to
$20 etc
2/ Have xml file with assorted pricing
3/ Have loader to place pic
3/ Looking to sort prices selected in ComboBox to go into
DataGrid
not using asp php or cf
Kind Regardsgxml toolkit appears to provide a good path for accomplishing this, no additional help needed.
Maybe you are looking for
-
Hey folks, I'm having some odd problems with DNS. Over the weekend I added a second ML server to my network. I changed the hostname on my original server from my FQDN to server1.domain.com. When I changed the hostname, the server created a new zone w
-
Do I need a converter to connect G5 to 20" CInema Display (both old)?
Hi. We moved from New York back to Buenos Aires three years ago. We brought our Power G5 and Cinema Display (I forgot what year we bought them but it must have been around 2006). There are no Apple Stores here and little support. Both the computer an
-
This is the message that I see when I try installing any version of Firefox: Your computer must be restarted to complete a previous uninstall of Firefox. Do you want to reboot now?
-
Tax calculation with and without Frieght Charges
Hi all, My Pricing Procedure is defined in the below mentioned way: Present Scenario:(Tax 4% is calculated on Freight Charges) Base amount = Rs.100/- Freight = Rs.20/- Rs. 120/- Tax 4% = Rs. 4.80 Total
-
Why do we need Interim Storage Type ?
Why do we need Interim Storage Type ? If you say it's acting as an intermediatary buffer location... Then why don't we need any Interim Storage for Bin to Bin stock movement?? Any pointers will be appreciated .