Re: [iText-questions] How to change a PDF but preserve the rights

2008-02-05 Thread Leonard Rosenthol

It can't.

If you make ANY changes to the PDF you will break the rights.  It's  
specifically designed this way to detect tampering.


The only choice you have, if you wish to distribute a file with  
Reader Enablement is to purchase Adobe LiveCycle ES and have it  
process your document AFTER you do whatever dynamic functionality you  
wish.


Leonard


On Feb 5, 2008, at 6:20 AM, Samuel B. Quiring wrote:

I don't get it.  How should this code be rewritten so that the  
resulting PDF still has the rights?  Do you know for a fact that it  
can be done?


-Sam

From: [EMAIL PROTECTED] [mailto:itext- 
[EMAIL PROTECTED] On Behalf Of Leonard  
Rosenthol

Sent: Tuesday, February 05, 2008 6:09 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] How to change a PDF but preserve the  
rights


You rewrote the PDF - therefore you changed it.

Leonard

On Feb 4, 2008, at 10:32 PM, Samuel B. Quiring wrote:


Leonard,
Are you sure? I have tried a few variations and I have not been  
able to get anything to work. I now have a simple identity()  
routine that changes nothing. The incoming PDF has rights that  
lets Reader save filled-in data. The resulting PDF has the rights  
removed. As far as I can tell, I changed nothing. What did I do  
wrong? Here is the code:

public static void identity()
{
PdfReader reader = new PdfReader(C:/tmp/niceForm.pdf);
reader.setAppendable(true);
XfaForm xfaForm = new XfaForm(reader);
FileOutputStream pdfOutput = new FileOutputStream(C:/tmp/ 
newFormOut.pdf);

PdfStamper stamper = new PdfStamper(reader, pdfOutput);

xfaForm.setXfa(stamper.getWriter());
stamper.close();
pdfOutput.close();
reader.close();
}
-Sam

- Original Message -
From: Leonard Rosenthol
To: Post all your questions about iText here
Sent: Monday, December 03, 2007 4:20 AM
Subject: Re: [iText-questions] How to change a PDF but preserve  
the rights


It _IS_ possible to fill in a PDF that has been Reader Enabled w/ 
o violating the rights - but it MUST be done in a very specific  
fashion using append mode on the source PDF AND only modifying a  
limited number of objects in the PDF.


So yes, if you are going to create a whole new PDF - you'll break  
the Reader Enabling. If you're careful about what you do, and  
how you do it, you CAN accomplish your goal.


Leonard


On Dec 3, 2007, at 2:05 AM, Samuel B. Quiring wrote:

I have a PDF containing an XFA form; isXfaPresent() == true. The  
PDF was authored so that it can be opened in Adobe Reader, fields  
in the form can be filled, and the form can be saved by Reader to  
the file system.
Using iText I have read in the PDF, obtained the XfaForm, changed  
values in the XML Document, and written a new PDF to the file  
system.
The PDF I write out contains the values I put into the XML, but  
the rights to save the PDF from Reader have been lost. Is this  
expected? Other features of the original PDF are also lost in the  
newly-written PDF.
I wrote the changed PDF to a new file. If this is the reason the  
save rights were lost, is there a way I can modify the existing  
PDF in place so that the rights to save the file from Adobe  
Reader are maintained?

-Sam
 
-
SF.Net email is sponsored by: The Future of Linux Business White  
Paper

from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/ 
8857-50307-18918-4___

iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/




- 

SF.Net email is sponsored by: The Future of Linux Business White  
Paper

from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4


___
iText-questions mailing list
iText-questions@lists.sourceforge.net
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 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ 
___

iText-questions mailing list
iText-questions@lists.sourceforge.net
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 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ 

Re: [iText-questions] How to change a PDF but preserve the rights

2008-02-05 Thread Samuel B. Quiring
I don't get it.  How should this code be rewritten so that the resulting PDF 
still has the rights?  Do you know for a fact that it
can be done?
 
-Sam

  _  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leonard
Rosenthol
Sent: Tuesday, February 05, 2008 6:09 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] How to change a PDF but preserve the rights


You rewrote the PDF - therefore you changed it. 

Leonard

On Feb 4, 2008, at 10:32 PM, Samuel B. Quiring wrote:


Leonard,

Are you sure? I have tried a few variations and I have not been able to get 
anything to work. I now have a simple identity() routine
that changes nothing. The incoming PDF has rights that lets Reader save 
filled-in data. The resulting PDF has the rights removed. As
far as I can tell, I changed nothing. What did I do wrong? Here is the code:

public static void identity()
{
PdfReader reader = new PdfReader(C:/tmp/niceForm.pdf);
reader.setAppendable(true);
XfaForm xfaForm = new XfaForm(reader);
FileOutputStream pdfOutput = new FileOutputStream(C:/tmp/newFormOut.pdf);
PdfStamper stamper = new PdfStamper(reader, pdfOutput);

xfaForm.setXfa(stamper.getWriter());
stamper.close();
pdfOutput.close();
reader.close();
}

-Sam



- Original Message - 
From: Leonard  mailto:[EMAIL PROTECTED] Rosenthol 
To: Post all your questions  mailto:itext-questions@lists.sourceforge.net 
about iText here 
Sent: Monday, December 03, 2007 4:20 AM
Subject: Re: [iText-questions] How to change a PDF but preserve the rights

It _IS_ possible to fill in a PDF that has been Reader Enabled w/o violating 
the rights - but it MUST be done in a very specific
fashion using append mode on the source PDF AND only modifying a limited 
number of objects in the PDF. 

So yes, if you are going to create a whole new PDF - you'll break the Reader 
Enabling. If you're careful about what you do, and
how you do it, you CAN accomplish your goal.

Leonard


On Dec 3, 2007, at 2:05 AM, Samuel B. Quiring wrote:


I have a PDF containing an XFA form; isXfaPresent() == true. The PDF was 
authored so that it can be opened in Adobe Reader, fields
in the form can be filled, and the form can be saved by Reader to the file 
system.

Using iText I have read in the PDF, obtained the XfaForm, changed values in the 
XML Document, and written a new PDF to the file
system.

The PDF I write out contains the values I put into the XML, but the rights to 
save the PDF from Reader have been lost. Is this
expected? Other features of the original PDF are also lost in the newly-written 
PDF.

I wrote the changed PDF to a new file. If this is the reason the save rights 
were lost, is there a way I can modify the existing PDF
in place so that the rights to save the file from Adobe Reader are maintained?

-Sam
-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/



  _  


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 

  _  


___
iText-questions mailing list
iText-questions@lists.sourceforge.net
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 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
iText-questions mailing list
iText-questions@lists.sourceforge.net
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 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] How to change a PDF but preserve the rights

2008-02-05 Thread Leonard Rosenthol

You rewrote the PDF - therefore you changed it.

Leonard

On Feb 4, 2008, at 10:32 PM, Samuel B. Quiring wrote:


Leonard,

Are you sure?  I have tried a few variations and I have not been  
able to get anything to work.  I now have a simple identity()  
routine that changes nothing.  The incoming PDF has rights that  
lets Reader save filled-in data.  The resulting PDF has the rights  
removed.  As far as I can tell, I changed nothing.  What did I do  
wrong?  Here is the code:


public static void identity()
{
PdfReader reader = new PdfReader(C:/tmp/niceForm.pdf);
reader.setAppendable(true);
XfaForm xfaForm = new XfaForm(reader);
FileOutputStream pdfOutput = new FileOutputStream(C:/tmp/ 
newFormOut.pdf);

PdfStamper stamper = new PdfStamper(reader, pdfOutput);

xfaForm.setXfa(stamper.getWriter());
stamper.close();
pdfOutput.close();
reader.close();
}

-Sam

- Original Message -
From: Leonard Rosenthol
To: Post all your questions about iText here
Sent: Monday, December 03, 2007 4:20 AM
Subject: Re: [iText-questions] How to change a PDF but preserve the  
rights


It _IS_ possible to fill in a PDF that has been Reader Enabled w/ 
o violating the rights - but it MUST be done in a very specific  
fashion using append mode on the source PDF AND only modifying a  
limited number of objects in the PDF.


So yes, if you are going to create a whole new PDF - you'll break  
the Reader Enabling.  If you're careful about what you do, and  
how you do it, you CAN accomplish your goal.


Leonard


On Dec 3, 2007, at 2:05 AM, Samuel B. Quiring wrote:

I have a PDF containing an XFA form; isXfaPresent() == true.  The  
PDF was authored so that it can be opened in Adobe Reader, fields  
in the form can be filled, and the form can be saved by Reader to  
the file system.


Using iText I have read in the PDF, obtained the XfaForm, changed  
values in the XML Document, and written a new PDF to the file system.


The PDF I write out contains the values I put into the XML, but  
the rights to save the PDF from Reader have been lost.  Is this  
expected?  Other features of the original PDF are also lost in the  
newly-written PDF.


I wrote the changed PDF to a new file.  If this is the reason the  
save rights were lost, is there a way I can modify the existing  
PDF in place so that the rights to save the file from Adobe Reader  
are maintained?


-Sam
- 

SF.Net email is sponsored by: The Future of Linux Business White  
Paper

from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/ 
8857-50307-18918-4___

iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/




-- 
---

SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4


___
iText-questions mailing list
iText-questions@lists.sourceforge.net
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 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ 
___

iText-questions mailing list
iText-questions@lists.sourceforge.net
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 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] How to change a PDF but preserve the rights

2008-02-05 Thread Samuel B. Quiring
So what did you mean in your earlier mail, quoted below, when you said It _IS_ 
possible to fill in a PDF that has been Reader
Enabled w/o violating the rights?
 
-Sam

  _  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leonard
Rosenthol
Sent: Tuesday, February 05, 2008 6:25 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] How to change a PDF but preserve the rights


It can't. 

If you make ANY changes to the PDF you will break the rights. It's specifically 
designed this way to detect tampering.

The only choice you have, if you wish to distribute a file with Reader 
Enablement is to purchase Adobe LiveCycle ES and have it
process your document AFTER you do whatever dynamic functionality you wish.

Leonard


On Feb 5, 2008, at 6:20 AM, Samuel B. Quiring wrote:


I don't get it. How should this code be rewritten so that the resulting PDF 
still has the rights? Do you know for a fact that it can
be done?

-Sam

  _  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leonard
Rosenthol
Sent: Tuesday, February 05, 2008 6:09 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] How to change a PDF but preserve the rights


You rewrote the PDF - therefore you changed it. 

Leonard

On Feb 4, 2008, at 10:32 PM, Samuel B. Quiring wrote:


Leonard,

Are you sure? I have tried a few variations and I have not been able to get 
anything to work. I now have a simple identity() routine
that changes nothing. The incoming PDF has rights that lets Reader save 
filled-in data. The resulting PDF has the rights removed. As
far as I can tell, I changed nothing. What did I do wrong? Here is the code:

public static void identity()
{
PdfReader reader = new PdfReader(C:/tmp/niceForm.pdf);
reader.setAppendable(true);
XfaForm xfaForm = new XfaForm(reader);
FileOutputStream pdfOutput = new FileOutputStream(C:/tmp/newFormOut.pdf);
PdfStamper stamper = new PdfStamper(reader, pdfOutput);

xfaForm.setXfa(stamper.getWriter());
stamper.close();
pdfOutput.close();
reader.close();
}

-Sam



- Original Message - 
From: Leonard  mailto:[EMAIL PROTECTED] Rosenthol 
To: Post all your  mailto:itext-questions@lists.sourceforge.net questions 
about iText here 
Sent: Monday, December 03, 2007 4:20 AM
Subject: Re: [iText-questions] How to change a PDF but preserve the rights

It _IS_ possible to fill in a PDF that has been Reader Enabled w/o violating 
the rights - but it MUST be done in a very specific
fashion using append mode on the source PDF AND only modifying a limited 
number of objects in the PDF. 

So yes, if you are going to create a whole new PDF - you'll break the Reader 
Enabling. If you're careful about what you do, and
how you do it, you CAN accomplish your goal.

Leonard


On Dec 3, 2007, at 2:05 AM, Samuel B. Quiring wrote:


I have a PDF containing an XFA form; isXfaPresent() == true. The PDF was 
authored so that it can be opened in Adobe Reader, fields
in the form can be filled, and the form can be saved by Reader to the file 
system.

Using iText I have read in the PDF, obtained the XfaForm, changed values in the 
XML Document, and written a new PDF to the file
system.

The PDF I write out contains the values I put into the XML, but the rights to 
save the PDF from Reader have been lost. Is this
expected? Other features of the original PDF are also lost in the newly-written 
PDF.

I wrote the changed PDF to a new file. If this is the reason the save rights 
were lost, is there a way I can modify the existing PDF
in place so that the rights to save the file from Adobe Reader are maintained?

-Sam
-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/



  _  


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 

  _  


___
iText-questions mailing list
iText-questions@lists.sourceforge.net
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 2008.

Re: [iText-questions] How to change a PDF but preserve the rights

2008-02-04 Thread Samuel B. Quiring
Leonard,

Are you sure?  I have tried a few variations and I have not been able to get 
anything to work.  I now have a simple identity() routine that changes nothing. 
 The incoming PDF has rights that lets Reader save filled-in data.  The 
resulting PDF has the rights removed.  As far as I can tell, I changed nothing. 
 What did I do wrong?  Here is the code:

public static void identity()
{
PdfReader reader = new PdfReader(C:/tmp/niceForm.pdf);
reader.setAppendable(true);
XfaForm xfaForm = new XfaForm(reader);
FileOutputStream pdfOutput = new FileOutputStream(C:/tmp/newFormOut.pdf);
PdfStamper stamper = new PdfStamper(reader, pdfOutput);

xfaForm.setXfa(stamper.getWriter());
stamper.close();
pdfOutput.close();
reader.close();
}

-Sam


  - Original Message - 
  From: Leonard Rosenthol 
  To: Post all your questions about iText here 
  Sent: Monday, December 03, 2007 4:20 AM
  Subject: Re: [iText-questions] How to change a PDF but preserve the rights


  It _IS_ possible to fill in a PDF that has been Reader Enabled w/o 
violating the rights - but it MUST be done in a very specific fashion using 
append mode on the source PDF AND only modifying a limited number of objects 
in the PDF.


  So yes, if you are going to create a whole new PDF - you'll break the Reader 
Enabling.  If you're careful about what you do, and how you do it, you CAN 
accomplish your goal.


  Leonard




  On Dec 3, 2007, at 2:05 AM, Samuel B. Quiring wrote:


I have a PDF containing an XFA form; isXfaPresent() == true.  The PDF was 
authored so that it can be opened in Adobe Reader, fields in the form can be 
filled, and the form can be saved by Reader to the file system.

Using iText I have read in the PDF, obtained the XfaForm, changed values in 
the XML Document, and written a new PDF to the file system.

The PDF I write out contains the values I put into the XML, but the rights 
to save the PDF from Reader have been lost.  Is this expected?  Other features 
of the original PDF are also lost in the newly-written PDF.

I wrote the changed PDF to a new file.  If this is the reason the save 
rights were lost, is there a way I can modify the existing PDF in place so that 
the rights to save the file from Adobe Reader are maintained?

-Sam
-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.

http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/




--


  -
  SF.Net email is sponsored by: The Future of Linux Business White Paper
  from Novell.  From the desktop to the data center, Linux is going
  mainstream.  Let it simplify your IT future.
  http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4


--


  ___
  iText-questions mailing list
  iText-questions@lists.sourceforge.net
  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 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] How to change a PDF but preserve the rights

2007-12-06 Thread Leonard Rosenthol
Trying to modify a Reader Enabled XFA-based PDF, without breaking the  
enablement is near impossible I don't recommend it.

Leonard


On Dec 6, 2007, at 7:01 AM, Sérgio Oliveira wrote:

 Hello,

 I´m also trying to achieve the same: change somes aspects of an  
 extended PDF file without breaking extended functionality.

 The aspects I´m trying to change using iText is the data section  
 and the scripts section of the xfa DOM. Using the code below, I´m  
 able to change both but:

 # if I call stp.AcroFields.Xfa.Changed = true; the rights will be lost
 # if I not call stp.AcroFields.Xfa.Changed = true; the data will  
 not be merged

 Even If I just create a stamper and call  
 stp.AcroFields.Xfa.Changed = true; without changing anything in  
 the PDF, the rights will be lost, so I suppose this line of code is  
 the problem.

 So, my question is, what this line of code does? If I don´t call  
 this property, my data will not be merged, but it will be inside  
 the PDf, because the resulting PDf is bigger.

 That is way I was wondering if we can call something like this  
 using code inside the PDF (after the user opened it) instead of  
 using iText. iText would place the data and the code into the PDF,  
 but the changed flag would be activated inside the PDF using  
 LiveCycle designer code.

 Thank you



 Code
 //
 PdfReader reader = new PdfReader(Server.MapPath(PDF_RDExtpdf.pdf));

 PdfStamper stp = new PdfStamper(reader, new FileStream(@c: 
 \newpdf.pdf, FileMode.CreateNew), reader.PdfVersion, true);

XmlDocument doc = new XmlDocument();
XmlDocument docXFA = new XmlDocument();
XmlDocument docXFT = new XmlDocument();

XmlNamespaceManager oNamespaceMgr = new XmlNamespaceManager  
 (doc.NameTable);
oNamespaceMgr.AddNamespace(xdp, http://ns.adobe.com/xdp/;);
oNamespaceMgr.AddNamespace(xfa, http://www.xfa.org/schema/ 
 xfa-data/1.0/);
oNamespaceMgr.AddNamespace(xft, http://www.xfa.org/schema/ 
 xfa-template/2.5/);


doc.LoadXml(stp.AcroFields.Xfa.DomDocument.InnerXml);
docXFA.Load(Server.MapPath(data.xdp));
docXFT.Load(Server.MapPath(scripts.xml));

// Data
XmlNodeList nlist = doc.SelectNodes(//xfa:datasets,  
 oNamespaceMgr);

for (i = 0; i = nlist.Count - 1; i++)
{
nlist[i].InnerXml = docXFA.SelectNodes(//xfa:datasets,  
 oNamespaceMgr).Item(0).ChildNodes[0].OuterXml;
}


 //scripts

 for (i = 0; i = nlist.Count - 1; i++)
{
nlist.Item(0).InnerXml = docXFT.ChildNodes[0].OuterXml;
}


 stp.AcroFields.Xfa.DomDocument.InnerXml = doc.InnerXml;
 stp.AcroFields.Xfa.Changed = true;
 stp.Close();
 // 
 /




 From: Leonard Rosenthol [EMAIL PROTECTED]
 Reply-To: Post all your questions about iText here itext- 
 [EMAIL PROTECTED]
 To: Post all your questions about iText here itext- 
 [EMAIL PROTECTED]
 Subject: Re: [iText-questions] How to change a PDF but preserve  
 the rights
 Date: Mon, 3 Dec 2007 10:58:33 -0500

 Nope and nope :(.

 Leonard

 On Dec 3, 2007, at 9:33 AM, Samuel B. Quiring wrote:

 Leonard,

 Is there any documentation anywhere on this?  Do you know of an   
 example iText program that I could look at?

 -Sam
 - Original Message -
 From: Leonard Rosenthol
 To: Post all your questions about iText here
 Sent: Monday, December 03, 2007 4:20 AM
 Subject: Re: [iText-questions] How to change a PDF but preserve  
 the  rights

 It _IS_ possible to fill in a PDF that has been Reader Enabled  
 w/ o violating the rights - but it MUST be done in a very  
 specific  fashion using append mode on the source PDF AND only  
 modifying a  limited number of objects in the PDF.

 So yes, if you are going to create a whole new PDF - you'll  
 break  the Reader Enabling.  If you're careful about what you  
 do, and  how you do it, you CAN accomplish your goal.

 Leonard


 On Dec 3, 2007, at 2:05 AM, Samuel B. Quiring wrote:

 I have a PDF containing an XFA form; isXfaPresent() == true.   
 The  PDF was authored so that it can be opened in Adobe Reader,  
 fields  in the form can be filled, and the form can be saved by  
 Reader to  the file system.

 Using iText I have read in the PDF, obtained the XfaForm,  
 changed  values in the XML Document, and written a new PDF to  
 the file system.

 The PDF I write out contains the values I put into the XML, but   
 the rights to save the PDF from Reader have been lost.  Is this   
 expected?  Other features of the original PDF are also lost in  
 the  newly-written PDF.

 I wrote the changed PDF to a new file.  If this is the reason  
 the  save rights were lost, is there a way I can modify the  
 existing  PDF in place so that the rights to save the file from  
 Adobe Reader  are maintained?

 -Sam
 --- 
 -- 
 SF.Net email 

Re: [iText-questions] How to change a PDF but preserve the rights

2007-12-03 Thread Leonard Rosenthol
It _IS_ possible to fill in a PDF that has been Reader Enabled w/o  
violating the rights - but it MUST be done in a very specific fashion  
using append mode on the source PDF AND only modifying a limited  
number of objects in the PDF.


So yes, if you are going to create a whole new PDF - you'll break the  
Reader Enabling.  If you're careful about what you do, and how you  
do it, you CAN accomplish your goal.


Leonard


On Dec 3, 2007, at 2:05 AM, Samuel B. Quiring wrote:

I have a PDF containing an XFA form; isXfaPresent() == true.  The  
PDF was authored so that it can be opened in Adobe Reader, fields  
in the form can be filled, and the form can be saved by Reader to  
the file system.


Using iText I have read in the PDF, obtained the XfaForm, changed  
values in the XML Document, and written a new PDF to the file system.


The PDF I write out contains the values I put into the XML, but the  
rights to save the PDF from Reader have been lost.  Is this  
expected?  Other features of the original PDF are also lost in the  
newly-written PDF.


I wrote the changed PDF to a new file.  If this is the reason the  
save rights were lost, is there a way I can modify the existing PDF  
in place so that the rights to save the file from Adobe Reader are  
maintained?


-Sam
-- 
---

SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/ 
8857-50307-18918-4___

iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] How to change a PDF but preserve the rights

2007-12-03 Thread Bruno Lowagie

Leonard Rosenthol wrote:
  It _IS_ possible to fill in a PDF that has been Reader Enabled w/o 
violating the rights - but it MUST be done in a very specific fashion 
using append mode on the source PDF AND only modifying a limited 
number of objects in the PDF.


Sorry, I stand corrected.
br,
Bruno


smime.p7s
Description: S/MIME Cryptographic Signature
-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] How to change a PDF but preserve the rights

2007-12-03 Thread Leonard Rosenthol

Nope and nope :(.

Leonard

On Dec 3, 2007, at 9:33 AM, Samuel B. Quiring wrote:


Leonard,

Is there any documentation anywhere on this?  Do you know of an  
example iText program that I could look at?


-Sam
- Original Message -
From: Leonard Rosenthol
To: Post all your questions about iText here
Sent: Monday, December 03, 2007 4:20 AM
Subject: Re: [iText-questions] How to change a PDF but preserve the  
rights


It _IS_ possible to fill in a PDF that has been Reader Enabled w/ 
o violating the rights - but it MUST be done in a very specific  
fashion using append mode on the source PDF AND only modifying a  
limited number of objects in the PDF.


So yes, if you are going to create a whole new PDF - you'll break  
the Reader Enabling.  If you're careful about what you do, and  
how you do it, you CAN accomplish your goal.


Leonard


On Dec 3, 2007, at 2:05 AM, Samuel B. Quiring wrote:

I have a PDF containing an XFA form; isXfaPresent() == true.  The  
PDF was authored so that it can be opened in Adobe Reader, fields  
in the form can be filled, and the form can be saved by Reader to  
the file system.


Using iText I have read in the PDF, obtained the XfaForm, changed  
values in the XML Document, and written a new PDF to the file system.


The PDF I write out contains the values I put into the XML, but  
the rights to save the PDF from Reader have been lost.  Is this  
expected?  Other features of the original PDF are also lost in the  
newly-written PDF.


I wrote the changed PDF to a new file.  If this is the reason the  
save rights were lost, is there a way I can modify the existing  
PDF in place so that the rights to save the file from Adobe Reader  
are maintained?


-Sam
- 

SF.Net email is sponsored by: The Future of Linux Business White  
Paper

from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/ 
8857-50307-18918-4___

iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/




-- 
---

SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4


___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
-- 
---

SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/ 
8857-50307-18918-4___

iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] How to change a PDF but preserve the rights

2007-12-03 Thread Scott Dunbar
The PDF was authored so that it can be opened in Adobe Reader, fields 
in the form can be filled, and the form can be saved by Reader to the 
file system.



I feel like I'm missing something.  You've got a PDF that appears to 
have at least PdfWriter.ALLOW_FILL_IN.  If the form has that permission 
(retrieved from PdfReader.getPermissions()) then your code should allow 
you to fill in the form.  If it has other permissions too then just set 
the output PDF with the result of PdfReader.getPermissions() using the 
PdfEncryptor.  Something on the order of:


PdfReader reader = new PdfReader( input.pdf );
int pdfPermissions = reader.getPermissions();
if( !(pdfPermissions  PdfWriter.ALLOW_FILL_IN))
   // throw exception?  exit?  either way, don't allow the form to be 
filled


//
// modify the pdf contents as needed
//
PdfEncryptor.encrypt( reader,
 new FileOutputStream( output.pdf),
 null, null,// no user name and password
 pdfPermissions,
 true);

I apologize if I've missed something but it seems that, based on your 
original question, this is what you wanted.




Leonard Rosenthol wrote:

Nope and nope :(.

Leonard

On Dec 3, 2007, at 9:33 AM, Samuel B. Quiring wrote:


Leonard,
 
Is there any documentation anywhere on this?  Do you know of an 
example iText program that I could look at?
 
-Sam


- Original Message -
*From:* Leonard Rosenthol mailto:[EMAIL PROTECTED]
*To:* Post all your questions about iText here
mailto:itext-questions@lists.sourceforge.net
*Sent:* Monday, December 03, 2007 4:20 AM
*Subject:* Re: [iText-questions] How to change a PDF but preserve
the rights

It _IS_ possible to fill in a PDF that has been Reader Enabled
w/o violating the rights - but it MUST be done in a very specific
fashion using append mode on the source PDF AND only modifying
a limited number of objects in the PDF.

So yes, if you are going to create a whole new PDF - you'll break
the Reader Enabling.  If you're careful about what you do, and
how you do it, you CAN accomplish your goal.

Leonard


On Dec 3, 2007, at 2:05 AM, Samuel B. Quiring wrote:

I have a PDF containing an XFA form; isXfaPresent() == true. 
The PDF was authored so that it can be opened in Adobe Reader,

fields in the form can be filled, and the form can be saved by
Reader to the file system.
 
Using iText I have read in the PDF, obtained the XfaForm,

changed values in the XML Document, and written a new PDF to the
file system.
 
The PDF I write out contains the values I put into the XML, but

the rights to save the PDF from Reader have been lost.  Is this
expected?  Other features of the original PDF are also lost in
the newly-written PDF.
 
I wrote the changed PDF to a new file.  If this is the reason

the save rights were lost, is there a way I can modify the
existing PDF in place so that the rights to save the file from
Adobe Reader are maintained?
 
-Sam

-
SF.Net email is sponsored by: The Future of Linux Business White
Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.

http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
iText-questions mailing list
iText-questions@lists.sourceforge.net
mailto:iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/





-
SF.Net email is sponsored by: The Future of Linux Business White
Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4



___
iText-questions mailing list
iText-questions@lists.sourceforge.net
mailto:iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
iText-questions mailing list
iText-questions@lists.sourceforge.net 

Re: [iText-questions] How to change a PDF but preserve the rights

2007-12-02 Thread Bruno Lowagie

Samuel B. Quiring wrote:
is there a way I can modify the existing PDF in 
place so that the rights to save the file from Adobe Reader are maintained?


This is only possible with software form Adobe.
It's one of the many sources of revenue for the company.
You won't find any other product that allows you to do what you want.
br,
Bruno


smime.p7s
Description: S/MIME Cryptographic Signature
-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/