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
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
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-08-21       - By Leonard Rosenthol

 Back
The text that Acrobat brings up is quite clear and indeed describes  
what you did:

"THIS DOCUMENT HAS BEEN CHANGED..."

Therefore, you need to apply any rights to the document AFTER you  
change it.  You can do this dynamically via Adobe LiveCycle Reader  
Extension Server, which can be licensed from Adobe.

The alternative is to switch from a mail-based system to a web-based  
one where the user POSTS the data back to a web server (ala HTML),  
since this can be done w/o the need for reader enabling the PDF.

Leonard


On Aug 21, 2007, at 4:35 PM, Robert Cearley wrote:

> Hi Leonard,
>
> Thanks for your reply.  Is there any other way to save the document  
> so the settings are not lost - a possible hack or via XFA?  Here's  
> the scenario.  We have a software system that has multiple pdf  
> templates that users can select to merge with their data.  They do  
> a merge and then download the merged document to enter additional  
> data on their side.  Once they are done, they mail the pdf document  
> back to the server, and the server imports the data they changed  
> back into the database.
>
> I was able to narrow it down to the following, which causes the  
> same problem.
>
> string sourcefilename = @"c:\temp\saveenabled.pdf";
> PdfReader reader = new PdfReader(sourcefilename);
> PdfStamper stamp = new PdfStamper(reader, File.Create(@"c:\temp
> \saveenabled1.pdf"));
> stamp.Close();
>
> When you open the document it says:  This document contained  
> certain rights to enable special features in adobe reader.  this  
> document has been changed since it was created and these rights are  
> no longer valid.  please contact the author for the original  
> version of this document.
>
>
>
> On 8/21/07, Leonard Rosenthol <leonardr@(protected)> wrote:
> You need to do your form filling BEFORE the PDF is "Reader Enabled".
>
>
> Leonard
>
> On Aug 21, 2007, at 3:43 PM, Robert Cearley wrote:
>
>>
>> In adobe professional 8.0, there is a setting called: Enable Usage  
>> rights in adobe reader.  This setting allows you to create a pdf  
>> document so a person can enter data into the pdf and save it.
>>
>> If I populate the pdf document using the setnodetext method below,  
>> the populate method works; however, the document seems to lose the  
>> ability for a user to type in data into the document and resave it.
>>
>> Here's what I'm trying to do.  The code below will populate some  
>> basic fields on a pdf.  The pdf will be sent to a user that will  
>> add additional text in the pdf. He will save the pdf with the data  
>> he entered; however, the save option is lost.  Any ideas?
>>
>>
>> Sample code:
>>
>>
>> PdfReader reader = new PdfReader(sourcefilename);
>> stamp = new PdfStamper(reader, File.Create( base.NewFileName));
>> AcroFields form = stamp.AcroFields;
>> XfaForm xfaForm = form.Xfa;
>> XmlNode internalIdNode;
>>
>> internalIdNode = xfaForm.FindDatasetsNode("firstname");
>> xfaForm.SetNodeText(internalIdNode, "john doe");
>>
>> stamp.FormFlattening = false ;
>> stamp.Close();
>>
>> Thanks...
>> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
>> ----
>> This SF.net email is sponsored by: Splunk Inc.
>> Still grepping through log files to find problems?  Stop.
>> Now Search log events and configuration files using AJAX and a  
>> browser.
>> Download your FREE copy of Splunk now >>  http://get.splunk.com/
>> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
>> iText-questions mailing list
>> iText-questions@(protected)
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>> Buy the iText book: http://itext.ugent.be/itext-in-action/
>
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
> ---
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a  
> browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> iText-questions mailing list
> iText-questions@(protected)
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
> ---
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a  
> browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> iText-questions mailing list
> iText-questions@(protected)
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/


<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line
-break: after-white-space; ">The text that Acrobat brings up is quite clear and
indeed describes what you did:<DIV><BR class="khtml-block-placeholder"></DIV>
<DIV>"THIS DOCUMENT HAS BEEN CHANGED..."</DIV><DIV><BR class="khtml-block
-placeholder"></DIV><DIV>Therefore, you need to apply any rights to the document
AFTER you change it.? You can do this dynamically via Adobe LiveCycle Reader
Extension Server, which can be licensed from Adobe.</DIV><DIV><BR class="khtml
-block-placeholder"></DIV><DIV>The alternative is to switch from a mail-based
system to a web-based one where the user POSTS the data back to a web server
(ala HTML), since this can be done w/o the need for reader enabling the PDF.<
/DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Leonard</DIV><DIV><BR
class="khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On Aug 21, 2007, at 4
:35 PM, Robert Cearley wrote:</DIV><BR class="Apple-interchange-newline">
<BLOCKQUOTE type="cite"><DIV><FONT size="2"><P>Hi Leonard,<BR><BR>Thanks for
your reply.??Is there any other way to save the document so the settings are
not lost - a possible hack or via XFA?? Here's the scenario.? We have a
software system that has multiple pdf templates that users can select to merge
with their data.? They do a merge and then download the merged document to
enter additional?data on their side.? Once they are done, they mail the pdf
document back to the server, and?the server?imports the data they changed back
into the database.? </P></FONT><P><FONT color="#0000ff" size="2">I was able to
narrow it down to the following, which causes the same problem.? </FONT></P><P>
<FONT color="#0000ff" size="2">string</FONT><FONT size="2"> sourcefilename = <
/FONT><FONT color="#a31515" size="2">@"c:\temp\saveenabled.pdf"</FONT><FONT size
="2">;<BR></FONT><FONT color="#2b91af" size="2">PdfReader </FONT><FONT size="2">
reader = </FONT><FONT color="#0000ff" size="2">new</FONT><FONT size="2"> </FONT
><FONT color="#2b91af" size="2">PdfReader</FONT><FONT size="2">(sourcefilename);
<BR></FONT><FONT color="#2b91af" size="2"> PdfStamper</FONT><FONT size="2">
stamp = </FONT><FONT color="#0000ff" size="2">new</FONT><FONT size="2"> </FONT>
<FONT color="#2b91af" size="2">PdfStamper</FONT><FONT size="2">(reader, </FONT>
<FONT color="#2b91af" size="2"> File</FONT><FONT size="2">.Create(</FONT><FONT
color="#a31515" size="2">@"c:\temp\saveenabled1.pdf"</FONT><FONT size="2">));
<BR></FONT><FONT size="2">stamp.Close();</FONT></P></DIV> <DIV>When you open the
document it says:? This document contained certain rights to enable special
features in adobe reader.? this document has been changed since it was created
and these rights are no longer valid.? please contact the author for the
original version of this document. </DIV> <DIV><BR><BR>?</DIV> <DIV><SPAN class
="gmail_quote">On 8/21/07, <B class="gmail_sendername">Leonard Rosenthol</B> &lt
;<A href="mailto:leonardr@(protected)">leonardr@(protected)</A>&gt; wrote:<
/SPAN> <BLOCKQUOTE class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px
0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> <DIV style="WORD-WRAP: break-word">You
need to do your form filling BEFORE the PDF is "Reader Enabled". <DIV><BR>?<
/DIV> <DIV>Leonard</DIV> <DIV><BR> <DIV> <DIV><SPAN class="e" id="q
_1148a0882dee4204_1"> <DIV>On Aug 21, 2007, at 3:43 PM, Robert Cearley wrote:<
/DIV><BR></SPAN></DIV> <BLOCKQUOTE type="cite"> <DIV><SPAN class="e" id="q
_1148a0882dee4204_3"><SPAN style="FONT-SIZE: 5pt"><SPAN> <DIV style="MARGIN: 0in
0in 0pt"><SPAN style="FONT-SIZE: 5pt"><FONT size="2"></FONT></SPAN>?</DIV> <DIV
style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 5pt"><FONT size="2">In
adobe professional 8.0, there is a setting called: Enable Usage rights in adobe
reader.? </FONT></SPAN><SPAN style="FONT-SIZE: 5pt"><FONT size="2"> This
setting allows you to create a pdf document so a person can?enter data?into?the
pdf?and save it.? </FONT></SPAN></DIV> <DIV style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 5pt"><FONT size="2"></FONT></SPAN>?</DIV> <DIV style="MARGIN:
0in 0in 0pt"><SPAN style="FONT-SIZE: 5pt"><FONT size="2">If I populate the pdf
document using the setnodetext method below, the populate method works; however
, the document seems to lose the ability for a user to type in data into the
document and resave it.? </FONT></SPAN></DIV> <DIV style="MARGIN: 0in 0in 0pt">
<SPAN style="FONT-SIZE: 5pt"><FONT size="2"></FONT></SPAN>?</DIV> <DIV style=
"MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 5pt"><FONT size="2">Here's what I
'm trying to do.? The code below will populate some basic fields on a pdf.? The
pdf will be sent to a user that will?add additional text in the pdf.?He will
save the pdf with the data he entered; however, the save option is lost.??Any
ideas?? </FONT></SPAN></DIV> <DIV style="MARGIN: 0in 0in 0pt"><SPAN style="FONT
-SIZE: 5pt"><FONT size="2"></FONT></SPAN>?</DIV> <DIV style="MARGIN: 0in 0in 0pt
"><SPAN style="FONT-SIZE: 5pt"><FONT size="2"></FONT></SPAN>?</DIV> <DIV style=
"MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 5pt"><FONT size="2">Sample code:<
/FONT></SPAN><SPAN style="FONT-SIZE: 5pt"> ?</SPAN></DIV> <DIV style="MARGIN:
0in 0in 0pt"><SPAN style="FONT-SIZE: 5pt"></SPAN>?</DIV> <DIV style="MARGIN:
0in 0in 0pt"><SPAN style="FONT-SIZE: 5pt"></SPAN>?</DIV> <DIV style="MARGIN:
0in 0in 0pt"><FONT size="2"><SPAN style="COLOR: #2b91af">PdfReader</SPAN><SPAN>
reader = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af"
>PdfReader</SPAN>(sourcefilename);</SPAN></FONT> </DIV> <DIV style="MARGIN: 0in
0in 0pt"><SPAN><FONT size="2">stamp = <SPAN style="COLOR: blue">new</SPAN>
<SPAN style="COLOR: #2b91af">PdfStamper</SPAN>(reader, <SPAN style="COLOR:
#2b91af">File</SPAN>.Create(<SPAN style="COLOR: blue"> base</SPAN>.NewFileName))
;</FONT></SPAN></DIV> <DIV style="MARGIN: 0in 0in 0pt"><FONT size="2"><SPAN
style="COLOR: #2b91af">AcroFields</SPAN><SPAN> form = stamp.AcroFields;</SPAN><
/FONT></DIV> <DIV style="MARGIN: 0in 0in 0pt"><FONT size="2"><SPAN style="COLOR:
#2b91af">XfaForm</SPAN><SPAN> xfaForm = form.Xfa;</SPAN></FONT></DIV> <DIV
style="MARGIN: 0in 0in 0pt"><FONT size="2"><SPAN style="COLOR: #2b91af">XmlNode
</SPAN><SPAN> internalIdNode;</SPAN></FONT></DIV><P style="MARGIN: 0in 0in 0pt">
<SPAN><FONT size="2">?</FONT></SPAN></P> <DIV style="MARGIN: 0in 0in 0pt"><SPAN>
<FONT size="2">internalIdNode = xfaForm.FindDatasetsNode("firstname");</FONT> <
/SPAN></DIV> <DIV style="MARGIN: 0in 0in 0pt"><SPAN><FONT size="2">xfaForm
.SetNodeText(internalIdNode, "john doe");<SPAN> ????? </SPAN><SPAN>?????????????
???????????</SPAN></FONT></SPAN></DIV><P style="MARGIN: 0in 0in 0pt"><SPAN><FONT
size="2">?</FONT></SPAN></P> <DIV style="MARGIN: 0in 0in 0pt"><SPAN><FONT size=
"2">stamp.FormFlattening = <SPAN style="COLOR: blue">false</SPAN> ;<SPAN>???????
???????? </SPAN><SPAN>????????????????</SPAN></FONT></SPAN></DIV> <DIV style=
"MARGIN: 0in 0in 0pt"><SPAN><FONT size="2">stamp.Close();<SPAN>??????????????? <
/SPAN></FONT></SPAN></DIV> <DIV style="MARGIN: 0in 0in 0pt"><SPAN><FONT size="2"
><SPAN></SPAN></FONT></SPAN>?</DIV> <DIV style="MARGIN: 0in 0in 0pt"><SPAN><FONT
size="2"><SPAN>Thanks...</SPAN></FONT></SPAN> </DIV></SPAN></SPAN></SPAN></DIV>
<DIV style="MARGIN: 0px">-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
-- ---- ---- ------</DIV> <DIV style="MARGIN: 0px">This SF.net email is
sponsored by: Splunk Inc.</DIV> <DIV style="MARGIN: 0px">Still grepping through
log files to find problems?<SPAN>? </SPAN>Stop.</DIV> <DIV style="MARGIN: 0px"
>Now Search log events and configuration files using AJAX and a browser.</DIV>
<DIV style="MARGIN: 0px">Download your FREE copy of Splunk now &gt;&gt;<SPAN>? <
/SPAN><A onclick="return top.js.OpenExtLink(window,event,this)" href="http://get
.splunk.com/__ ____ ____ ____ ____ ____ ____ ____ ____ ____" target="_blank">
http://get.splunk.com/__ ____ ____ ____ ____ ____ ____ ____ ____ ____</A></DIV>
<DIV style="MARGIN: 0px">iText-questions mailing list</DIV> <DIV style="MARGIN:
0px"><A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto
:iText-questions@(protected)" target="_blank">iText-questions@(protected)
.sourceforge.net</A></DIV> <DIV style="MARGIN: 0px"><A onclick="return top.js
.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists
/listinfo/itext-questions" target="_blank">https://lists.sourceforge.net/lists
/listinfo/itext-questions </A></DIV> <DIV style="MARGIN: 0px">Buy the iText book
: <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://itext
.ugent.be/itext-in-action/" target="_blank">http://itext.ugent.be/itext-in
-action/</A></DIV></BLOCKQUOTE> </DIV><BR>?</DIV></DIV><BR>-- ---- ---- ---- ---
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----<BR>This SF.net email is
sponsored by: Splunk Inc.<BR>Still grepping through log files to find problems?
?Stop.<BR>Now Search log events and configuration files using AJAX and a
browser. <BR>Download your FREE copy of Splunk now &gt;&gt; ?<A onclick="return
top.js.OpenExtLink(window,event,this)" href="http://get.splunk.com/" target="
_blank">http://get.splunk.com/</A><BR>__ ____ ____ ____ ____ ____ ____ ____ ____
__ __ <BR>iText-questions mailing list<BR><A onclick="return top.js.OpenExtLink
(window,event,this)" href="mailto:iText-questions@(protected)">iText
-questions@(protected)</A><BR><A onclick="return top.js.OpenExtLink
(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/itext
-questions" target="_blank"> https://lists.sourceforge.net/lists/listinfo/itext
-questions</A><BR>Buy the iText book: <A onclick="return top.js.OpenExtLink
(window,event,this)" href="http://itext.ugent.be/itext-in-action/" target="
_blank">http://itext.ugent.be/itext-in-action/ </A><BR><BR></BLOCKQUOTE></DIV>
<BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin
-left: 0px; ">-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
-- ----</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px;
margin-left: 0px; ">This SF.net email is sponsored by: Splunk Inc.</DIV><DIV
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px
; ">Still grepping through log files to find problems?<SPAN class="Apple
-converted-space">? </SPAN>Stop.</DIV><DIV style="margin-top: 0px; margin-right:
0px; margin-bottom: 0px; margin-left: 0px; ">Now Search log events and
configuration files using AJAX and a browser.</DIV><DIV style="margin-top: 0px;
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Download your FREE
copy of Splunk now &gt;&gt;<SPAN class="Apple-converted-space">? </SPAN><A href
="http://get.splunk.com/__ ____ ____ ____ ____ ____ ____ ____ ____ ____">http:/
/get.splunk.com/__ ____ ____ ____ ____ ____ ____ ____ ____ ____</A></DIV><DIV
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px
; ">iText-questions mailing list</DIV><DIV style="margin-top: 0px; margin-right:
0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:iText-questions
@(protected)">iText-questions@(protected)</A></DIV><DIV
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px
; "><A href="https://lists.sourceforge.net/lists/listinfo/itext-questions">https
://lists.sourceforge.net/lists/listinfo/itext-questions</A></DIV><DIV style=
"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Buy
the iText book: <A href="http://itext.ugent.be/itext-in-action/">http://itext
.ugent.be/itext-in-action/</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

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