[iText-questions] PDFStamper Moreinfo

2010-05-17 Thread Murugesh Annadurai
Hi Paulo,

 

Thanks for the reply. Under what XMP schema do they go? 

 

I also have a kind of general question. Is there a possibility for some
documents (not necessarily created using iText) to have only DocInfo and not
XMP metadata? Should I check both these places to read the document's
metadata?

 

Thanks,

Murugesh.




 

XMP and DocInfo.

 

Paulo

  - Original Message - 

  From: Murugesh Annadurai 

  To: itext-questions@lists.sourceforge.net 

  Sent: Sunday, May 16, 2010 2:13 AM

  Subject: [iText-questions] PDFStamper Moreinfo

 

 

  Hello All,

 

   

 

  I am using iText for reading/writing PDF properties. I would like to know 

where actually does the properties set through PdfStamper.SetMoreInfo() get 

saved within the PDF file. Do they go into any XMP schemas or someplace
else? 

Would greatly appreciate any pointers.

 

   

 

  Thank you,

 

  Murugesh.

 

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: [iText-questions] How to detect the absolute height of previous last line of "text"?

2010-05-17 Thread Lu, Tao (MOH)
Hi, Guys,

Any clue? 

Many thanks!

Best Regards,
Tao


> _ 
> From: Lu, Tao (MOH)  
> Sent: May 13, 2010 1:27 PM
> To:   itext-questions@lists.sourceforge.net
> Subject:  How to detect the absolute height of previous last line
> of "text"? 
> 
> Hi, Guys,
> 
> I am using ColumnText to draw some "text" to the PdfContentByte. How
> to detect the absolute height of previous last line of "text". 
> 
> Many thanks!
> 
> Best Regards,
> Tao
--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: [iText-questions] Acroform bordercolor null

2010-05-17 Thread Arnaud Garcia
Hi Mark and thanks for helping,

I am very sorry, but I don't understand what to do, because I already set a
value to the field after setting the border to null. I also tried using:
form.regenerateField("myField");


here the code, and the pdf file :
PdfReader pdfreader = new PdfReader("test.pdf");
PdfStamper stamp = new PdfStamper(pdfreader, new
FileOutputStream("test_filled.pdf"));

AcroFields form = stamp.getAcroFields();
form.setFieldProperty("firstname", "bordercolor", null, null);
form.regenerateField("firstname");
form.setField("firstname", "Arnaud");
stamp.setFormFlattening(true);
stamp.close();


thanks for help,
Arnaud

2010/5/17 Mark Storer 

> Simply changing the value of the border color isn't enough.  You need to
> force the field to generate a new appearance as well.  Setting its value
> (even to its current value) will do the trick.
>
> --Mark Storer
>  Senior Software Engineer
>  Cardiff.com
>
> import legalese.Disclaimer;
> Disclaimer DisCard = null;
>
>
>
> > -Original Message-
> > From: arnaud74130 [mailto:arn...@imagemed-87.com]
> > Sent: Saturday, May 15, 2010 6:01 AM
> > To: itext-questions@lists.sourceforge.net
> > Subject: [iText-questions] Acroform bordercolor null
> >
> >
> > Hi List,
> > I try to remove the border from my acroform, without success ??
> > There was a previous post:
> > http://itext-general.2136553.n4.nabble.com/PdfStamper-changes-
> > text-field-framing-td2157072.html#a2157072
> >
> > .. and Paulo did it, but I still don't understand how ?  I
> > have exactly the same code as Christopher ... and I use his
> > pdf forms as an example, and it is not working ...
> >
> > So if someone or Paulo ;-), can explain a little more 
> >
> >
> > Thanks for helping,
> >
> > Arnaud
> > --
> > View this message in context:
> > http://itext-general.2136553.n4.nabble.com/Acroform-bordercolo
> r-null-tp2217721p2217721.html
> > Sent from the iText - General mailing list archive at Nabble.com.
> >
> > --
> > 
> >
> > ___
> > iText-questions mailing list
> > iText-questions@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
> > Buy the iText book: http://www.itextpdf.com/book/ Check the
> > site with examples before you ask questions:
> > http://www.1t3xt.info/examples/ You can also search the
> > keywords list: http://1t3xt.info/tutorials/keywords/
> >
> >
> > No virus found in this incoming message.
> > Checked by AVG - www.avg.com
> > Version: 9.0.819 / Virus Database: 271.1.1/2842 - Release
> > Date: 05/16/10 23:26:00
> >
>
>
> --
>
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.itextpdf.com/book/
> Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
> You can also search the keywords list:
> http://1t3xt.info/tutorials/keywords/
>


test.pdf
Description: Adobe PDF document
--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

[iText-questions] Digital Signature - Externally Signed?

2010-05-17 Thread chorpeac

I need to be able to sign on the client (since no private key is on the
server), and then pass the bytes to the server (where iTextSharp resides) to
apply the signature. 

Can this be done? 

I checked this out 
http://itextpdf.sourceforge.net/howtosign.html#signextstd
http://itextpdf.sourceforge.net/howtosign.html#signextstd  but it needs the
private key...
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Digital-Signature-Externally-Signed-tp2220099p2220099.html
Sent from the iText - General mailing list archive at Nabble.com.

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


Re: [iText-questions] Reading and Parsing Tagged Pdf

2010-05-17 Thread Mark Storer
Based on the description of TaggedPdfReaderTool:
 
"Converts a tagged PDF document into an XML file. "
 
...I'd say you're misusing the class.  You should be writing out that
XML file and then examining it.
 
Now if that's what you're already doing, then the class has a bug.
Submit a PDF, and the output XML to the list, and we'll get it fixed.
 
--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer DisCard = null;
 
 




From: Selvakumar, Sivagnanam [mailto:s.selvakum...@spi-bpo.com] 
Sent: Friday, May 14, 2010 8:35 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Reading and Parsing Tagged Pdf



Any suggestions?

 

From: Selvakumar, Sivagnanam [mailto:s.selvakum...@spi-bpo.com] 
Sent: Wednesday, May 12, 2010 3:59 PM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] Reading and Parsing Tagged Pdf

 

Dear All,

 

I have the tagged pdf where I am trying to read and parse using
com.itextpdf.text.pdf.parser.TaggedPdfReaderTool
  class. It only reads root element and ignores child elements.
 

Please help me out how to read child element also from the
tagged pdf.

 

Regards,

Selvakumar

 

 

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.819 / Virus Database: 271.1.1/2842 - Release Date:
05/16/10 23:26:00




<>--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: [iText-questions] iText Read Chuncks of PDF into java

2010-05-17 Thread Mark Storer
Don't we have a FAQ for this somewhere?

Extracting text from PDF is a Nontrivial Exercise.  It's flippin' hard.
Text in PDF is just characters and coordinates.  No paragraphs or rows
or lines.  Just "draw glyph foo of font bar with this transformation
matrix ()".  Often, you can avoid the "glyph from a font" step and
get some kind of human encoding ("WinAnsi", "MacRoman", several others),
but not always.

To figure out lines and paragraphs you need to figure out the locations
of all those characters (which could be in any order, not just reading
order... Text is often drawn by font, or size... But it's perfectly
legal to draw all the 'a's, then all the 'b's, and so forth.  Hard and
inefficient, but legal).

If these are PDFs you yourself are building, you have a couple options
available to you:
1) Marked Content AKA PDF Structure
With PDF Structure you can mark parts of a content stream as part of
some logical object... A table, paragraph, whatever.  You can then read
that structure to extract the information you want.

2) Custom tags in the PDF.  AKA "cheating".  ;)  Write all the text you
want to store somewhere in the PDF as text, broken up so its in the
format you want.  You then suck it back out at your leisure. 

Structure is pretty much the Adobe-supported way of implementing #2.
It's a bit more complex than writing out a long string of text with some
odd delimiters, but is more portable.  Other people might actually make
use of it that way.

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer DisCard = null;
 
 

> -Original Message-
> From: crimeunit [mailto:nielspauwel...@gmail.com] 
> Sent: Monday, May 17, 2010 5:57 AM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] iText Read Chuncks of PDF into java
> 
> 
> Hello,
> 
> I'm spending a lot of time after searching a solution of my 
> following problem;
> 
> with the iText in Java I wan't to read out the Chunks for 
> each paragraph.
> (because I want to have a list of all 'links-to-other-pdf-file')
> 
> 
> 
> 
> if I have a first test application that's working for getting 
> thee example
> test1 and test2:
> 
> Chunk chunk = new Chunk();
> chunk.setRemoteGoto("test1", "test2");
> ArrayList listChunks = chunk.getChunks(); for (Chunk 
> chnk : listChunks) {
>   chnk.getContent();  
> }
> 
> 
> 
> but now is my problem, these chuks not from my setted 
> example, but of a pdf that's read in.
> (my opinion is to first load every paragraph of the first 
> document, and take every chunck of these paragraphs)
> 
> Can somebody help me out please???
> 
> Appriciated in advance!
> --
> View this message in context: 
> http://itext-general.2136553.n4.nabble.com/iText-Read-Chuncks-
> of-PDF-into-java-tp2219554p2219554.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> --
> 
> 
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.itextpdf.com/book/ Check the 
> site with examples before you ask questions: 
> http://www.1t3xt.info/examples/ You can also search the 
> keywords list: http://1t3xt.info/tutorials/keywords/
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.819 / Virus Database: 271.1.1/2842 - Release 
> Date: 05/16/10 23:26:00
> 

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


Re: [iText-questions] iText causing thread stuck

2010-05-17 Thread Mike Marchywka











> Date: Mon, 17 May 2010 09:02:24 -0700
> From: msto...@autonomy.com
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] iText causing thread stuck
>
> I googled "stuck executethread", and the discissions I turned up were
> about a fixed max thread run time that was configurable (and seems to
> default to 600 seconds, 10 minutes). Your "self-tuning" thing may be
> ignoring that in favor of something Fancy.
>
> I suspect you need to find a way to tell your server that this thread is
> going to take a long time, and that's okay... A WebLogic question, not
> an iText one.
>
> Now if you want to figure out how to speed up iText, that belongs
> here... But most of the efficiency improvements available are in the IO,
> while your thread is being halted in what looks like code involved in
> building your PdfTable in memory, not writing it out.
>
> You might throw in some logic to take any table of more than X rows and
> generate them in separate documents in series, such that you can get
> each part done reasonably quickly. Once all the portions of the table
> have been generated, you can stitch the PDFs back together, AT THE PAGE
> LEVEL. It is, for all practical purposes, impossible to extract rows
> and append them to existing documents. Pages or bust.
>
> --Mark Storer
> Senior Software Engineer
> Cardiff.com
>
> import legalese.Disclaimer;
> Disclaimer DisCard = null;
>
>
>
>> -Original Message-
>> From: stitches [mailto:sarifi...@sbcglobal.net]
>> Sent: Friday, May 14, 2010 12:21 PM
>> To: itext-questions@lists.sourceforge.net
>> Subject: [iText-questions] iText causing thread stuck
>>
>>
>> Hi - I'm relatively new to Java and iText. I took over a
>> project for someone else, we're running it in Weblogic 10.3
>> We have a dynamic report (dynamic in the sense that the
>> columns and the order of columns are chosen by the end user,
>> and the different columns can have different rowspans), which
>> we would like to export to PDF. If the dataset is relatively
>> small, we have no problems. But when the table is extremely
>> large, the export hangs in a thread stuck. I really hope you
>> can help me out, this is quite urgent.
>> Below is the error we are receiving. Thanks in advance.
>>
>> Thread-36 "[STUCK] ExecuteThread: '2' for queue:
>> 'weblogic.kernel.Default (self-tuning)'" 
>> priority=1, DAEMON> {
>> com.lowagie.text.pdf.PdfLine.getChunk(Unknown Source)
>> com.lowagie.text.pdf.PdfCell.firstLineRealHeight(Unknown Source)
>> com.lowagie.text.pdf.PdfCell.setBottom(Unknown Source)
>> com.lowagie.text.pdf.PdfDocument.addPdfTable(Unknown Source)
>> com.lowagie.text.pdf.PdfDocument.add(Unknown Source)
>> com.lowagie.text.Document.add(Unknown Source)
>>
>> com.novartis.dra.tap.servlets.CustomPDFGenerator.doPost(Custom
>> PDFGenerator.java:64)
>>
>> com.novartis.dra.tap.servlets.CustomPDFGenerator.doGet(CustomP
>> DFGenerator.java:59)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:700)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
>>
>> weblogic.servlet.internal.StubSecurityHelper$ServletServiceAct
> ion.run(StubSecurityHelper.java:224)
>>
>> weblogic.servlet.internal.StubSecurityHelper.invokeServlet(Stu
>> bSecurityHelper.java:108)
>>
>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubI
>> mpl.java:198)
>>
>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubI
>> mpl.java:175)
>>
>> weblogic.servlet.internal.WebAppServletContext$ServletInvocati
> onAction.run(WebAppServletContext.java:3468)
>>
>> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authe
>> nticatedSubject.java:308)
>> weblogic.security.service.SecurityManager.runAs(Unknown Source)
>>
>> weblogic.servlet.internal.WebAppServletContext.securedExecute(
>> WebAppServletContext.java:2116)
>>
>> weblogic.servlet.internal.WebAppServletContext.execute(WebAppS
>> ervletContext.java:2038)
>>
>> weblogic.servlet.internal.ServletRequestImpl.run(ServletReques
>> tImpl.java:1372)
>> weblogic.work.ExecuteThread.execute(ExecuteThread.java:198)
>> weblogic.work.ExecuteThread.run(ExecuteThread.java:165)
>> }
>> --

See some of the servlet lists. Servlets are meant to be diminuitive ("lets")
things that run on a server to handle short tractable
requests while a remote connection stays open. Even if you
could keep the thread alive you may not maintain the
connection- what if request comes in over a wireless link or
two? You need to change the paradigm.






  
_
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
--

___
iText-questions mailing list
iText-que

Re: [iText-questions] iText causing thread stuck

2010-05-17 Thread Mark Storer
I googled "stuck executethread", and the discissions I turned up were
about a fixed max thread run time that was configurable (and seems to
default to 600 seconds, 10 minutes).  Your "self-tuning" thing may be
ignoring that in favor of something Fancy.

I suspect you need to find a way to tell your server that this thread is
going to take a long time, and that's okay... A WebLogic question, not
an iText one.

Now if you want to figure out how to speed up iText, that belongs
here... But most of the efficiency improvements available are in the IO,
while your thread is being halted in what looks like code involved in
building your PdfTable in memory, not writing it out.

You might throw in some logic to take any table of more than X rows and
generate them in separate documents in series, such that you can get
each part done reasonably quickly.  Once all the portions of the table
have been generated, you can stitch the PDFs back together, AT THE PAGE
LEVEL.  It is, for all practical purposes, impossible to extract rows
and append them to existing documents.  Pages or bust.

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer DisCard = null;
 
 

> -Original Message-
> From: stitches [mailto:sarifi...@sbcglobal.net] 
> Sent: Friday, May 14, 2010 12:21 PM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] iText causing thread stuck
> 
> 
> Hi -  I'm relatively new to Java and iText.  I took over a 
> project for someone else, we're running it in Weblogic 10.3  
> We have a dynamic report (dynamic in the sense that the 
> columns and the order of columns are chosen by the end user, 
> and the different columns can have different rowspans), which 
> we would like to export to PDF.  If the dataset is relatively 
> small, we have no problems.  But when the table is extremely 
> large, the export hangs in a thread stuck.  I really hope you 
> can help me out, this is quite urgent.
> Below is the error we are receiving.  Thanks in advance.
> 
> Thread-36 "[STUCK] ExecuteThread: '2' for queue: 
> 'weblogic.kernel.Default (self-tuning)'"  priority=1, DAEMON> {
> com.lowagie.text.pdf.PdfLine.getChunk(Unknown Source)
> com.lowagie.text.pdf.PdfCell.firstLineRealHeight(Unknown Source)
> com.lowagie.text.pdf.PdfCell.setBottom(Unknown Source)
> com.lowagie.text.pdf.PdfDocument.addPdfTable(Unknown Source)
> com.lowagie.text.pdf.PdfDocument.add(Unknown Source)
> com.lowagie.text.Document.add(Unknown Source)
>
> com.novartis.dra.tap.servlets.CustomPDFGenerator.doPost(Custom
> PDFGenerator.java:64)
>
> com.novartis.dra.tap.servlets.CustomPDFGenerator.doGet(CustomP
> DFGenerator.java:59)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:700)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
>
> weblogic.servlet.internal.StubSecurityHelper$ServletServiceAct
ion.run(StubSecurityHelper.java:224)
>
> weblogic.servlet.internal.StubSecurityHelper.invokeServlet(Stu
> bSecurityHelper.java:108)
>
> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubI
> mpl.java:198)
>
> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubI
> mpl.java:175)
>
> weblogic.servlet.internal.WebAppServletContext$ServletInvocati
onAction.run(WebAppServletContext.java:3468)
>
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authe
> nticatedSubject.java:308)
> weblogic.security.service.SecurityManager.runAs(Unknown Source)
>
> weblogic.servlet.internal.WebAppServletContext.securedExecute(
> WebAppServletContext.java:2116)
>
> weblogic.servlet.internal.WebAppServletContext.execute(WebAppS
> ervletContext.java:2038)
>
> weblogic.servlet.internal.ServletRequestImpl.run(ServletReques
> tImpl.java:1372)
> weblogic.work.ExecuteThread.execute(ExecuteThread.java:198)
> weblogic.work.ExecuteThread.run(ExecuteThread.java:165)
> }
> --
> View this message in context: 
> http://itext-general.2136553.n4.nabble.com/iText-causing-threa
d-stuck-tp2217101p2217101.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> --
> 
> 
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.itextpdf.com/book/ Check the 
> site with examples before you ask questions: 
> http://www.1t3xt.info/examples/ You can also search the 
> keywords list: http://1t3xt.info/tutorials/keywords/
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.819 / Virus Database: 271.1.1/2842 - Release 
> Date: 05/16/10 23:26:00
> 

--

___
iText-questions mailing list
iText-questions@lists.sour

Re: [iText-questions] Encryption and XFA Forms

2010-05-17 Thread Leonard Rosenthol



-Original Message-
From: Mark Storer [mailto:msto...@autonomy.com] 
Sent: Monday, May 17, 2010 11:50 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Encryption and XFA Forms

You need to set them to locked in the XML, from "is" in your case.
Messing with the PDF directly is very hit-or-miss, and can easily change
from one version to the next.  That your code works could easily be
considered a bug to be fixed in the next point release of Adobe's
various PDF viewers.

I'm not exactly current on the XFA schema these days, but perhaps
Leonard could point you towards some documentation?

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer DisCard = null;
 
 

> -Original Message-
> From: Adam Carless [mailto:adam.carl...@hansard.com] 
> Sent: Monday, May 17, 2010 8:36 AM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] Encryption and XFA Forms
> 
> Hi Leonard,
> 
> > You are directly writing XFA form information (via fillXfaForm)
>  > BUT_ then you use the acroFields APIs to change the lock state
>  > - you can NOT mix these two!   Either you are working with XFA
>  > _OR_ you are working with AcroForms.   It's like cross the
>  > streams
> 
> That does seem to be what I'm doing, and it doesn't make any 
> sense to me either. 
> All I can say is that it's working, so I assumed it was just 
> a case where iText says one thing, but actually does another. 
> If it doesn't make any sense to you, could you clarify what 
> you meant in your reply saying:
> 
> > Set the locked attributes on the fields.
> 
> That comment started me looking into what attributes were 
> available on the individual fields, which is how I came up 
> with the working code I've given, after much trial and error 
> with the various undocumented constants and parameters 
> available for the various field types.
> 
> However, I can't find any "locked" parameter, attribute, 
> property, etc on any of the Acroform fields or XFA fields. So 
> if there's a better way, I'm happy to listen - how would you 
> "set the locked attributes on the fields"?
> 
> Thanks,
> Adam
> 
> The contents of this message and any attachments are 
> confidential and are intended for the use of the persons to 
> whom it is addressed.
> If you are not the intended recipient, you should not copy, 
> forward, use or alter the message in any way, nor disclose 
> its contents to any other person.
> Please notify the sender immediately and delete the e-mail 
> from your system, if you so wish you can contact us on +44 
> 1624 688000. The sender is not responsible for any 
> alterations that may have occurred without authorisation.
> Any files attached to this email will have been checked by us 
> with virus detection software before transmission. You should 
> carry out your own virus checks before opening any 
> attachments, as we do not accept any liability for loss or 
> damage which may be caused by viruses.
> 
> For information regarding company registration please visit 
> the contact page at www.hansard.com
> 
> --
> 
> 
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.itextpdf.com/book/ Check the 
> site with examples before you ask questions: 
> http://www.1t3xt.info/examples/ You can also search the 
> keywords list: http://1t3xt.info/tutorials/keywords/
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.819 / Virus Database: 271.1.1/2842 - Release 
> Date: 05/16/10 23:26:00
> 

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


Re: [iText-questions] Encryption and XFA Forms

2010-05-17 Thread Leonard Rosenthol
XFA fields support lock/read-only attributes as well.  You need to change XML 
in the XFA template.  Same idea as form filling the XFA, but different place in 
the grammar.

-Original Message-
From: Adam Carless [mailto:adam.carl...@hansard.com] 
Sent: Monday, May 17, 2010 11:36 AM
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] Encryption and XFA Forms

Hi Leonard,

> You are directly writing XFA form information (via fillXfaForm) 
 > BUT_ then you use the acroFields APIs to change the lock state
 > - you can NOT mix these two!   Either you are working with XFA
 > _OR_ you are working with AcroForms.   It's like cross the
 > streams

That does seem to be what I'm doing, and it doesn't make any sense to me 
either. 
All I can say is that it's working, so I assumed it was just a case where iText 
says one thing, but actually does another. If it doesn't make any sense to you, 
could you clarify what you meant in your reply saying:

> Set the locked attributes on the fields.

That comment started me looking into what attributes were available on the 
individual fields, which is how I came up with the working code I've given, 
after much trial and error with the various undocumented constants and 
parameters available for the various field types.

However, I can't find any "locked" parameter, attribute, property, etc on any 
of 
the Acroform fields or XFA fields. So if there's a better way, I'm happy to 
listen - how would you "set the locked attributes on the fields"?

Thanks,
Adam

The contents of this message and any attachments are confidential and are
intended for the use of the persons to whom it is addressed.
If you are not the intended recipient, you should not copy, forward, use or
alter the message in any way, nor disclose its contents to any other person.
Please notify the sender immediately and delete the e-mail from your system,
if you so wish you can contact us on +44 1624 688000. The sender is not
responsible for any alterations that may have occurred without authorisation.
Any files attached to this email will have been checked by us with virus
detection software before transmission. You should carry out your own virus
checks before opening any attachments, as we do not accept any liability for
loss or damage which may be caused by viruses.

For information regarding company registration please visit the contact page at 
www.hansard.com

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


Re: [iText-questions] Encryption and XFA Forms

2010-05-17 Thread Mark Storer
You need to set them to locked in the XML, from "is" in your case.
Messing with the PDF directly is very hit-or-miss, and can easily change
from one version to the next.  That your code works could easily be
considered a bug to be fixed in the next point release of Adobe's
various PDF viewers.

I'm not exactly current on the XFA schema these days, but perhaps
Leonard could point you towards some documentation?

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer DisCard = null;
 
 

> -Original Message-
> From: Adam Carless [mailto:adam.carl...@hansard.com] 
> Sent: Monday, May 17, 2010 8:36 AM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] Encryption and XFA Forms
> 
> Hi Leonard,
> 
> > You are directly writing XFA form information (via fillXfaForm)
>  > BUT_ then you use the acroFields APIs to change the lock state
>  > - you can NOT mix these two!   Either you are working with XFA
>  > _OR_ you are working with AcroForms.   It's like cross the
>  > streams
> 
> That does seem to be what I'm doing, and it doesn't make any 
> sense to me either. 
> All I can say is that it's working, so I assumed it was just 
> a case where iText says one thing, but actually does another. 
> If it doesn't make any sense to you, could you clarify what 
> you meant in your reply saying:
> 
> > Set the locked attributes on the fields.
> 
> That comment started me looking into what attributes were 
> available on the individual fields, which is how I came up 
> with the working code I've given, after much trial and error 
> with the various undocumented constants and parameters 
> available for the various field types.
> 
> However, I can't find any "locked" parameter, attribute, 
> property, etc on any of the Acroform fields or XFA fields. So 
> if there's a better way, I'm happy to listen - how would you 
> "set the locked attributes on the fields"?
> 
> Thanks,
> Adam
> 
> The contents of this message and any attachments are 
> confidential and are intended for the use of the persons to 
> whom it is addressed.
> If you are not the intended recipient, you should not copy, 
> forward, use or alter the message in any way, nor disclose 
> its contents to any other person.
> Please notify the sender immediately and delete the e-mail 
> from your system, if you so wish you can contact us on +44 
> 1624 688000. The sender is not responsible for any 
> alterations that may have occurred without authorisation.
> Any files attached to this email will have been checked by us 
> with virus detection software before transmission. You should 
> carry out your own virus checks before opening any 
> attachments, as we do not accept any liability for loss or 
> damage which may be caused by viruses.
> 
> For information regarding company registration please visit 
> the contact page at www.hansard.com
> 
> --
> 
> 
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.itextpdf.com/book/ Check the 
> site with examples before you ask questions: 
> http://www.1t3xt.info/examples/ You can also search the 
> keywords list: http://1t3xt.info/tutorials/keywords/
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.819 / Virus Database: 271.1.1/2842 - Release 
> Date: 05/16/10 23:26:00
> 

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


Re: [iText-questions] Acroform bordercolor null

2010-05-17 Thread Mark Storer
Simply changing the value of the border color isn't enough.  You need to
force the field to generate a new appearance as well.  Setting its value
(even to its current value) will do the trick.

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer DisCard = null;
 
 

> -Original Message-
> From: arnaud74130 [mailto:arn...@imagemed-87.com] 
> Sent: Saturday, May 15, 2010 6:01 AM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Acroform bordercolor null
> 
> 
> Hi List,
> I try to remove the border from my acroform, without success ??
> There was a previous post:
> http://itext-general.2136553.n4.nabble.com/PdfStamper-changes-
> text-field-framing-td2157072.html#a2157072
> 
> .. and Paulo did it, but I still don't understand how ?  I 
> have exactly the same code as Christopher ... and I use his 
> pdf forms as an example, and it is not working ...
> 
> So if someone or Paulo ;-), can explain a little more 
> 
> 
> Thanks for helping,
> 
> Arnaud
> --
> View this message in context: 
> http://itext-general.2136553.n4.nabble.com/Acroform-bordercolo
r-null-tp2217721p2217721.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> --
> 
> 
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Buy the iText book: http://www.itextpdf.com/book/ Check the 
> site with examples before you ask questions: 
> http://www.1t3xt.info/examples/ You can also search the 
> keywords list: http://1t3xt.info/tutorials/keywords/
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.819 / Virus Database: 271.1.1/2842 - Release 
> Date: 05/16/10 23:26:00
> 

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


Re: [iText-questions] Encryption and XFA Forms

2010-05-17 Thread Adam Carless
Hi Leonard,

> You are directly writing XFA form information (via fillXfaForm) 
 > BUT_ then you use the acroFields APIs to change the lock state
 > - you can NOT mix these two!   Either you are working with XFA
 > _OR_ you are working with AcroForms.   It's like cross the
 > streams

That does seem to be what I'm doing, and it doesn't make any sense to me 
either. 
All I can say is that it's working, so I assumed it was just a case where iText 
says one thing, but actually does another. If it doesn't make any sense to you, 
could you clarify what you meant in your reply saying:

> Set the locked attributes on the fields.

That comment started me looking into what attributes were available on the 
individual fields, which is how I came up with the working code I've given, 
after much trial and error with the various undocumented constants and 
parameters available for the various field types.

However, I can't find any "locked" parameter, attribute, property, etc on any 
of 
the Acroform fields or XFA fields. So if there's a better way, I'm happy to 
listen - how would you "set the locked attributes on the fields"?

Thanks,
Adam

The contents of this message and any attachments are confidential and are
intended for the use of the persons to whom it is addressed.
If you are not the intended recipient, you should not copy, forward, use or
alter the message in any way, nor disclose its contents to any other person.
Please notify the sender immediately and delete the e-mail from your system,
if you so wish you can contact us on +44 1624 688000. The sender is not
responsible for any alterations that may have occurred without authorisation.
Any files attached to this email will have been checked by us with virus
detection software before transmission. You should carry out your own virus
checks before opening any attachments, as we do not accept any liability for
loss or damage which may be caused by viruses.

For information regarding company registration please visit the contact page at 
www.hansard.com

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


[iText-questions] iText Read Chuncks of PDF into java

2010-05-17 Thread crimeunit

Hello,

I'm spending a lot of time after searching a solution of my following
problem;

with the iText in Java I wan't to read out the Chunks for each paragraph.
(because I want to have a list of all 'links-to-other-pdf-file')




if I have a first test application that's working for getting thee example
test1 and test2:

Chunk chunk = new Chunk();
chunk.setRemoteGoto("test1", "test2");
ArrayList listChunks = chunk.getChunks();
for (Chunk chnk : listChunks)
{
  chnk.getContent();
}



but now is my problem, these chuks not from my setted example, but of a pdf
that's read in.
(my opinion is to first load every paragraph of the first document, and take
every chunck of these paragraphs)

Can somebody help me out please???

Appriciated in advance!
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/iText-Read-Chuncks-of-PDF-into-java-tp2219554p2219554.html
Sent from the iText - General mailing list archive at Nabble.com.

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


Re: [iText-questions] Encryption and XFA Forms

2010-05-17 Thread Leonard Rosenthol
Adam - I'm confused!!

You are directly writing XFA form information (via fillXfaForm) _BUT_ then you 
use the acroFields APIs to change the lock state - you can NOT mix these two!   
Either you are working with XFA _OR_ you are working with AcroForms.   It's 
like cross the streams

Leonard

-Original Message-
From: Adam Carless [mailto:adam.carl...@hansard.com] 
Sent: Monday, May 17, 2010 7:04 AM
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] Encryption and XFA Forms

Big thanks to Mark and Leonard for all your help, I've finally got my head 
around the problem now and sorted out the solution.

In case it's useful to anyone else, here's the core code I've ended up with to 
fill in and lock an XFA form (ignoring any AcroForm parts). This code doesn't 
include any exception handling, checks, or other PDF manipulation, it's just to 
show the form filling & securing part...

InputSource is = new InputSource(new StringReader(passedXfaData));
is.setEncoding("UTF-8");

ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfStamper stamper = new PdfStamper(passedPdfReader, baos);

// must have ALLOW_FILL_IN otherwise fillXfaForm() silently fails
stamper.getWriter().setEncryption(PdfWriter.ENCRYPTION_AES_128, "", "", 
PdfWriter.ALLOW_PRINTING | PdfWriter.ALLOW_FILL_IN);

// mergeXfaData() ignores an XFA form if there is also an AcroForm in the PDF
// So get the XfaForm explicitly and fill that, so no AcroForm stuff happens.
AcroFields acroFields = stamper.getAcroFields();
XfaForm xfaForm = acroFields.getXfa();
xfaForm.fillXfaForm(is);

// once the form is filled in, we have to mark each of the fields as readonly
// so the users can't edit the values in the final PDF.
HashMap fieldMap = acroFields.getFields();
for (String fieldName : fieldMap.keySet()) {
   acroFields.setFieldProperty(fieldName, "setfflags", 
PdfFormField.FF_READ_ONLY, null);
}

stamper.setFullCompression();
stamper.close();

return baos.toByteArray();


Thanks again to Mark and Leonard for all the help, it's much appreciated.

Adam Carless

The contents of this message and any attachments are confidential and are
intended for the use of the persons to whom it is addressed.
If you are not the intended recipient, you should not copy, forward, use or
alter the message in any way, nor disclose its contents to any other person.
Please notify the sender immediately and delete the e-mail from your system,
if you so wish you can contact us on +44 1624 688000. The sender is not
responsible for any alterations that may have occurred without authorisation.
Any files attached to this email will have been checked by us with virus
detection software before transmission. You should carry out your own virus
checks before opening any attachments, as we do not accept any liability for
loss or damage which may be caused by viruses.

For information regarding company registration please visit the contact page at 
www.hansard.com

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


Re: [iText-questions] Encryption and XFA Forms

2010-05-17 Thread Adam Carless
Big thanks to Mark and Leonard for all your help, I've finally got my head 
around the problem now and sorted out the solution.

In case it's useful to anyone else, here's the core code I've ended up with to 
fill in and lock an XFA form (ignoring any AcroForm parts). This code doesn't 
include any exception handling, checks, or other PDF manipulation, it's just to 
show the form filling & securing part...

InputSource is = new InputSource(new StringReader(passedXfaData));
is.setEncoding("UTF-8");

ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfStamper stamper = new PdfStamper(passedPdfReader, baos);

// must have ALLOW_FILL_IN otherwise fillXfaForm() silently fails
stamper.getWriter().setEncryption(PdfWriter.ENCRYPTION_AES_128, "", "", 
PdfWriter.ALLOW_PRINTING | PdfWriter.ALLOW_FILL_IN);

// mergeXfaData() ignores an XFA form if there is also an AcroForm in the PDF
// So get the XfaForm explicitly and fill that, so no AcroForm stuff happens.
AcroFields acroFields = stamper.getAcroFields();
XfaForm xfaForm = acroFields.getXfa();
xfaForm.fillXfaForm(is);

// once the form is filled in, we have to mark each of the fields as readonly
// so the users can't edit the values in the final PDF.
HashMap fieldMap = acroFields.getFields();
for (String fieldName : fieldMap.keySet()) {
   acroFields.setFieldProperty(fieldName, "setfflags", 
PdfFormField.FF_READ_ONLY, null);
}

stamper.setFullCompression();
stamper.close();

return baos.toByteArray();


Thanks again to Mark and Leonard for all the help, it's much appreciated.

Adam Carless

The contents of this message and any attachments are confidential and are
intended for the use of the persons to whom it is addressed.
If you are not the intended recipient, you should not copy, forward, use or
alter the message in any way, nor disclose its contents to any other person.
Please notify the sender immediately and delete the e-mail from your system,
if you so wish you can contact us on +44 1624 688000. The sender is not
responsible for any alterations that may have occurred without authorisation.
Any files attached to this email will have been checked by us with virus
detection software before transmission. You should carry out your own virus
checks before opening any attachments, as we do not accept any liability for
loss or damage which may be caused by viruses.

For information regarding company registration please visit the contact page at 
www.hansard.com

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


[iText-questions] Question about iText and fields

2010-05-17 Thread Florin.ZOE
Hello,
 
My name is Florin ZOE. I am a Java Developer and I develop an
application which uses iText 2.1.7 in order to generate on the fly a pdf
file from within a Spring application. So basically the view for one of
my Spring controllers is a Java class which extends AbstractPdfView
class. It took a lot of time to generate the pdf file using Table and
Cell classes.
 
But I have a problem:
 
I have a request to add some fields (checkboxes, textfield, radiobuttons
etc) to my dynamic generated pdf file and to let the user to fill in
those fields with some values. Moreover the user should be able to
submit the pdf form in order to generate a new pdf with the entered
values. 
 
So, in the same step, when I generate the pdf file, in some of my table
cells I should be able to add different fields. 
 
Please note that I don't use PdfPTable or PdfPCell in my implementation.

 
I don't know if is possible to do this from Spring but maybe you can
tell me what is the best approach in order to fulfill what I said
before.
 
Thanks in advance for your support,
 
Best Regards,
 
Florin ZOE
--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

[iText-questions] Question about iText and fields

2010-05-17 Thread Florin Zoe
Hello,
 
My name is Florin 
ZOE. I am a Java Developer and I develop an application which uses iText 2.1.7 
in order to generate on the fly a pdf file from within a Spring application. So 
basically the view for one of my Spring controllers is a Java class which 
extends AbstractPdfView class. It took a lot of time to generate the pdf file 
using Table and Cell classes.
 
But I have a 
problem:
 
I have a request to 
add some fields (checkboxes, textfield, radiobuttons etc) to my dynamic 
generated pdf file and to let the user to fill in those fields with some 
values. 
Moreover the user should be able to submit the pdf form in order to generate a 
new pdf with the entered values. 
 
So, in the same 
step, when I generate the pdf file, in some of my table cells I should be able 
to add different fields. 
 
Please note that I 
don't use PdfPTable or PdfPCell in my implementation.  
 
I don't know if is 
possible to do this from Spring but maybe you can tell me what is the best 
approach in order to fulfill what I said before.
 
Thanks in advance 
for your support,
 
Best 
Regards,
 
Florin 
ZOE


  --

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/