You are here:

Java/PDF Creation Using Given XML and XSL and Signing and watermark

Advertisement


Question
Dear Sir,
Please Please help me I m trying Lot of Time But I did not get any help to generate PDF Using XML and XSl.I have found Only One things that First Create HTML File Using XML and XSl and then convert this HTML file to PDF File.

Sir I want to Use Itext.jar

I have One XML :=
<?xml version="1.0"?>
<report>
<persondetail>
<name>Vishal Singh</name>
<surname>9990806510</surname>
</persondetail>

<persondetail>
<name>Vishal Singh</name>
<surname>9990806510</surname>
</persondetail>

</report>

and One XSl====>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="report/persondetail">
<table width="100%" border="1" height="2%" cellpadding="2">
<tr>
<td width="10%"> <xsl:value-of select="name"/> </td>
<td width="90%"> <xsl:value-of select="surname"/> </td>
</tr>

</table>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Sir I want To generate PDF file With Signing and waterMark.

Answer
Hi Naval,
So you have XML with data.
You transform it to HTML using the XSL.
And you want to transform the HTML to PDF using iText.

In general I think it will be easier to use iText to create the PDF using the data from the XML. Meaning, that you write the code to parse the XML and pass the string to iText.
Anyway, you should read the iText documentation.
And there are plenty of hints on the web. Here is a start:
http://stackoverflow.com/questions/235851/using-itext-to-convert-html-to-pdf

Ziv

Java

All Answers


Answers by Expert:


Ask Experts

Volunteer


Ziv Ben-Eliahu

Expertise

I can answer questions relating to: Java language and usage, coding standards, application modeling and design (model driven development), unit/system testing, test driven development, algorithm complexity issues, Ant and XML-technologies.

Experience

I'm in the software industry for over 4 years now. I worked mainly with Java, but also with other languages. I gave practical session for "System Programming", in university.

Organizations
Open-Source community

Publications
WikiAI08

Education/Credentials
B.Sc. in Math and Computer Science, BGU.
M.Sc. in Computer Science, BGU.

Past/Present Clients
Open source (and free) projects: D.U.C.K (source-forge), JXN for wireXN.

Organizations
Open-Source community

Publications
WikiAI08

Education/Credentials
B.Sc. in Math and Computer Science, BGU.
M.Sc. in Computer Science, BGU.

Past/Present Clients
Open source (and free) projects: D.U.C.K (source-forge), JXN for wireXN.

Publications
WikiAI08

Education/Credentials
B.Sc. in Math and Computer Science, BGU.
M.Sc. in Computer Science, BGU.

Past/Present Clients
Open source (and free) projects: D.U.C.K (source-forge), JXN for wireXN.

Education/Credentials
B.Sc. in Math and Computer Science, BGU.
M.Sc. in Computer Science, BGU.

Past/Present Clients
Open source (and free) projects: D.U.C.K (source-forge), JXN for wireXN.

Past/Present Clients
Open source (and free) projects: D.U.C.K (source-forge), JXN for wireXN.

©2016 About.com. All rights reserved.