Page 1 of 1

XML and PDF files

Posted: Wed May 27, 2015 4:03 pm
by LasseThid
Is it possible to read data from an XML file containing information for more than one PDF file and then embed the data in the correct PDF file, or is it better to have one XML per PDF?

From an XML file like this...

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<order>
	<pof>ordernumber</pof>
	<system>client</system>
	<products>
		<product1>
			<filename>file_1.pdf</filename>
			<type>product_type</type>
			<quantity>qty</quantity>
			<paper>stock_name</paper>
			<color>front+back</color>
			<width>X</width>
			<height>Y</height>
			<weight>Z</weight>
		</product1>
		<product2>
			<filename>file_2.pdf</filename>
			<type>product_type</type>
			<quantity>qty</quantity>
			<paper>stock_name</paper>
			<color>front+back</color>
			<width>X</width>
			<height>Y</height>
			<weight>Z</weight>
		</product2>
		<product3>
			<filename>file_3.pdf</filename>
			<type>product_type</type>
			<quantity>qty</quantity>
			<paper>stock_name</paper>
			<color>front+back</color>
			<width>X</width>
			<height>Y</height>
			<weight>Z</weight>
		</product3>
	</products>
</order>
...I would like to embed the product1 data into file_1.pdf, the product2 data into file_2.pdf and so on.

If it's possible how do I do it?

Thanks in advance

Re: XML and PDF files

Posted: Wed May 27, 2015 4:35 pm
by dkelly
Unless you want to write a custom javascript or XSL it would be easier to create a separate XML for each PDF.

Re: XML and PDF files

Posted: Thu May 28, 2015 1:52 pm
by LasseThid
Thanks.

I'll have the customer generate one XML per PDF file then.