Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
-none-

-none-

2007-09-10       - By Gerold Krommer

 Back
Hi Paolo,

thanks for your effort.

I'm not sure you know that cartoon with the stork that has almost completely
swallowed the frog, but the frog is still gagging the storks throat and caption
says 'Never give up'.

I have used the pdf toolbox to inspect my 2ndpage.pdf. It seems to me that on
the (empty) first page there are some remainders (streams) of the flattened
form, namely the filled in fields. Why this isn't visible is beyond me. What
used to be the static text of the form seems to be gone.

How could such a thing happen?

I'm rechecking my code, but I cannot see how I could inadvertently step on
content that I have already added to a document.

/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.

-- --Urspr?ngliche Nachricht-- --
Von: itext-questions-bounces@(protected) [mailto:itext-questions
-bounces@(protected)] Im Auftrag von Paulo Soares
Gesendet: Montag, 10. September 2007 18:25
An: Post all your questions about iText here
Betreff: Re: [iText-questions] Is a flattened form special?

I can't reproduce the problem. I did:

PdfReader r = new PdfReader("c:\\hihi.pdf");
Image img = Image.getInstance(writer.getImportedPage(r, 1));
img.setAbsolutePosition(0, 0);
doc.add(img);
doc.newPage();

in all the files that you sent and all worked correctly. It may be some freak
problem from a faulty JVM instalation, I don't know.

Paulo

> -- --Original Message-- --
> From: itext-questions-bounces@(protected)
> [mailto:itext-questions-bounces@(protected)] On
> Behalf Of Gerold Krommer
> Sent: Monday, September 10, 2007 4:11 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Is a flattened form special?
>
>
> Thanks Paolo,
>
> This hint didn't fix it. I'm completely baffled about this,
> especially since I cannot reproduce it with a small
> self-contained program.
>
> I tried to look at the final PDF with the toolbox utilites,
> but my PDF knowledge isn't good enough (I used to be able to
> read PostScript, albeit somewhat slower than a PS printer).
>
> What I did now is to stop producing a document after the
> first, second and last level of my folder hierarch and
> lo-and-behold somewhat seems to overwrite the previous page!
>
> If you look at 1stpage.pdf it is correct, if I continue to
> the next level 2ndpage has a correct 2nd page, but the first
> is (visually) empty.
>
> If you look at complete.pdf you see two empty pages, third
> page from the flattened form is correct and the fourth page
> is the actual document (converted from a Tiff file).
>
> I'm not mangling in any way with the output stream, so figure
> me scratching my head until it hurts.
>
> Maybe if one of the PDF gods looks at this, he/she can figure
> out where I was contemplating wrongly.
>
> Now what an frustrating weekend that was ....
>
> /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.
>
>
> -- --Urspr?ngliche Nachricht-- --
> Von: itext-questions-bounces@(protected)
> [mailto:itext-questions-bounces@(protected)] Im
> Auftrag von Paulo Soares
> Gesendet: Samstag, 08. September 2007 14:53
> An: Post all your questions about iText here
> Betreff: Re: [iText-questions] Is a flattened form special?
>
> I think I was looking at the wrong place. Try:
>
>  PdfReader pdfCoverReader = new PdfReader("C:\\hihi.pdf");
> <-- this is the
> flattened form
>
>        PdfImportedPage pip =
> _pdfWriter.getImportedPage(pdfCoverReader, 1);
>
>        Image foo = Image.getInstance(pip);
>
>         foo.setAbsolutePosition(0, 0);
>
>        _pdfDocument.add(foo);
>
>        _pdfDocument.newPage();
>
>
> Paulo
>
> -- -- Original Message -- --
> From: "Gerold Krommer" <Gerold.Krommer@(protected)>
> To: "Post all your questions about iText here"
> <itext-questions@(protected)>
> Sent: Saturday, September 08, 2007 12:58 PM
> Subject: Re: [iText-questions] Is a flattened form special?
>
>
> Hi Paolo,
>
>
>
> thanks for looking into this. I have attached the original
> form from LC 7,
> the result of the filling and flattening and below is the
> function that is
> used for filling, flattening and appending to the document.
>
> Nevermind my funny namings :-)
>
>
>
> If I have time this weekend I will try to reproduce it with a
> small code
> sample.
>
>
>
> Thanks for the exellent work.
>
>
>
>   private void printFolderCoverSheet
> (com.filenet.wcm.api.Folder folder,
> PdfOutline outline, int numDocs){
>
>
>
>     PdfOutline tmpOutline;
>
>     try {
>
>
>
>       PdfReader reader = new PdfReader("FolderPrintCoverSheet.pdf");
>
>       PdfStamper stamper = new PdfStamper(reader,
>
>                                           new
> FileOutputStream("C:\\hihi.pdf"));
>
>       /**
>
>       *  @(protected) better naming convention
>
>       */
>
>       AcroFields form = stamper.getAcroFields();
>
>
>
>       HashMap fields = form.getFields();
>
>       String key;
>
>
>
>       for (Iterator i = fields.keySet().iterator(); i.hasNext(); ) {
>
>         key = (String) i.next();
>
>
>
>         // We retrieve a field name from the acro form. Field name is
> defined as the last character sequence in the name hierarchy
>
>         // which contains a [] at the end
>
>
>
>         String acroFieldName =
> key.substring(key.lastIndexOf(".")+1,key.lastIndexOf("["));
>
>         System.out.print(acroFieldName + ": ");
>
>         switch (form.getFieldType(key)) {
>
>           case AcroFields.FIELD_TYPE_TEXT:        // We only
> look at fields
> of type text
>
>             try{
>
>               form.setField(key, getFolderProperty(folder,
> acroFieldName));
> //getFolderProperty retrieves a property value from the
> folder with the same
> name property as the acro field name
>
>             } catch (PropertyNotFoundException pnf){
>
>                 // Explicitly do nothing when the property is
> not found.
>
>             }
>
>
>
>
>
>         }
>
>       }
>
>
>
>       reader.close();
>
>       stamper.setFormFlattening(true);
>
>       stamper.close();
>
>
>
>       //Append just created PDF to the output stream
>
>
>
>       PdfReader pdfCoverReader = new PdfReader("C:\\hihi.pdf");
>
>       PdfImportedPage pip =
> _pdfWriter.getImportedPage(pdfCoverReader, 1);
>
>       Image foo = Image.getInstance(pip);
>
>
>
>       _pdfDocument.add(foo);
>
>       _pdfDocument.newPage();
>
>     }
>
>     catch (DocumentException de) {
>
>       System.out.println(de.getMessage());
>
>     }
>
>     catch (IOException ioe) {
>
>       System.out.println(ioe.getMessage());
>
>     }
>
>   }
>
>
>
> /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.
>
> __ ____ ____ ____ ____ ____ ____
>
> Von: itext-questions-bounces@(protected)
> [mailto:itext-questions-bounces@(protected)] Im
> Auftrag von Paulo
> Soares
> Gesendet: Freitag, 07. September 2007 16:58
> An: Post all your questions about iText here
> Betreff: Re: [iText-questions] Is a flattened form special?
>
>
>
> Can you post hihi.pdf?
>
>
>
> Paulo
>
>
>
>
> __ ____ ____ ____ ____ ____ ____
>
>
> From: itext-questions-bounces@(protected)
> [mailto:itext-questions-bounces@(protected)] On
> Behalf Of Gerold
> Krommer
> Sent: Friday, September 07, 2007 9:17 AM
> To: itext-questions@(protected)
> Subject: [iText-questions] Is a flattened form special?
>
>
>
> 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


Aviso Legal:
Esta mensagem ? destinada exclusivamente ao destinat?rio. Pode conter informa?
?o confidencial ou legalmente protegida. A incorrecta transmiss?o desta mensagem
n?o significa a perca de confidencialidade. Se esta mensagem for recebida por
engano, por favor envie-a de volta para o remetente e apague-a do seu sistema
de imediato. ? proibido a qualquer pessoa que n?o o destinat?rio de usar,
revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
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/

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
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/

©2008 junlu.com - Jax Systems, LLC, U.S.A.