  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | -none- | -none- 2007-09-07 - By Gerold Krommer
Back
I am using iText 2.0.4 to create a single document out of many document contained in a DMS repository. This works flawlessly. Some of the documents in the DMS are already PDF and inclusion of them is no problem.
To separate the documents I insert a cover sheet with some information about the following document (date created, owner , whathaveyou) and use a static PDF form (created in LC Designer 7) to fill in the fields.
Then I flatten the single page form and want to include it in my output stream. The same code that works with other PDFs gives me an empty page and absolutely no error.
This is the absolutely trivial code snippet which I basically copied from 'iText in Action' which I'm a proud owner of.
PdfReader pdfCoverReader = new PdfReader("C:\\hihi.pdf"); <-- this is the flattened form
PdfImportedPage pip = _pdfWriter.getImportedPage(pdfCoverReader, 1);
Image foo = Image.getInstance(pip);
_pdfDocument.add(foo);
_pdfDocument.newPage();
Since this works in other places, this makes me wonder if there is something special about the flattened forms.
/DI Gerold Krommer
Manager Pre- und Postsales
ASTRON Business Services G.m.b.H., Vienna, Austria
Tel.: +43 1 585 31 90-22
Fax: +43 1 585 31 90-15
CONFIDENTIAL NOTICE: The contents of this message, including any attachments, are confidential and are intended solely for the use of the person or entity to whom the message was addressed. If you are not the intended recipient of this message, please be advised that any dissemination, distribution, or use of the contents of this message is strictly prohibited. If you received this message in error, please notify the sender. Please also permanently delete all copies of the original message and any attached documentation. Thank you.
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft -com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1= "urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC -html40">
<head> <meta http-equiv=Content-Type content="text/html; charset=us-ascii"> <meta name=Generator content="Microsoft Word 11 (filtered medium)"> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="country-region"/> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"/> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"/> <!--[if !mso]> <style> st1\:*{behavior:url(#default#ieooui) } </style> <![endif]--> <style> <!-- /* Font Definitions */ @(protected) {font-family:Wingdings; panose-1 (See http://ose-1.ora-code.com):5 0 0 0 0 0 0 0 0 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} span.E-MailFormatvorlage17 {mso-style-type:personal-compose; font-family:Arial; color:windowtext;} @(protected) Section1 {size:595.3pt 841.9pt; margin:70.85pt 70.85pt 2.0cm 70.85pt;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1" /> </o:shapelayout></xml><![endif]--> </head>
<body lang=DE link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>I am using iText 2.0.4 to create a single document out of many document contained in a DMS repository. This works flawlessly. Some of the documents in the DMS are already PDF and inclusion of them is no problem.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>To separate the documents I insert a cover sheet with some information about the following document (date created, owner , whathaveyou) and use a static PDF form (created in LC Designer 7) to fill in the fields.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>Then I flatten the single page form and want to include it in my output stream. The same code that works with other PDFs gives me an empty page and absolutely no error.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>This is the absolutely trivial code snippet which I basically copied from ‘iText in Action’ which I’m a proud owner of.<o:p ></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>PdfReader pdfCoverReader = new PdfReader("C:\\hihi.pdf"); </span></font><font size=2 face=Wingdings><span lang=EN-GB style='font-size:10.0pt;font-family:Wingdings'> ß</span></font><font size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'> this is the flattened form<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'> PdfImportedPage pip = _pdfWriter.getImportedPage(pdfCoverReader, 1);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'> </span></font><font size=2 face=Arial><span lang=FR style='font-size:10.0pt;font-family:Arial'>Image foo = Image.getInstance(pip);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'> _pdfDocument.add(foo); <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'> _pdfDocument.newPage();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>Since this works in other places, this makes me wonder if there is something special about the flattened forms.<o:p></o:p>< /span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>/DI Gerold Krommer</span></font><span lang=EN-GB><o:p ></o:p></span></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>Manager Pre- und Postsales</span></font><span lang=EN-GB><o:p></o:p></span></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>ASTRON Business Services G.m.b.H., <st1:place w:st="on"><st1:City w:st="on">Vienna</st1:City>, <st1:country-region w:st="on" >Austria</st1:country-region></st1:place></span></font><span lang=EN-GB><o:p></o:p></span></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>Tel.: +43 1 585 31 90-22</span></font><span lang=EN-GB><o:p></o:p></span></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size: 10.0pt;font-family:Arial'>Fax: +43 1 585 31 90-15</span></font><span lang=EN-GB><o:p></o:p></span></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB style='font-size:12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <b><i><font size=1 face=Arial><span lang=EN-GB style='font-size:7.5pt;font-family:Arial; font-weight:bold;font-style:italic'>CONFIDENTIAL NOTICE</span></font></i></b><i ><font size=1 face=Arial><span lang=EN-GB style='font-size:7.5pt;font-family:Arial; font-style:italic'>: The contents of this message, including any attachments, are confidential and are intended solely for the use of the person or entity to whom the message was addressed. If you are not the intended recipient of this message, please be advised that any dissemination, distribution, or use of the contents of this message is strictly prohibited. If you received this message in error, please notify the sender. Please also permanently delete all copies of the original message and any attached documentation.</span></font></i><i> <span lang=EN-GB style='font-style:italic'> </span></i><i><font size=1 face=Arial> <span lang=DE-AT style='font-size:7.5pt;font-family:Arial;font-style:italic'>Thank you.</span></font></i><font size=1><span style='font-size:8.0pt'><o:p></o:p>< /span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size: 12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|
 |