Prev: print
Next: geoLocator
From: iborsb on
I get the following problem when trying to use the refactored iText 1.4.6.

Class coldfusion.runtime.java.JavaProxy can not access a member of class
com.lowagie.textNew.pdf.PdfWriter with modifiers "protected"

Im trying to call the following function.
pdfWriter.setViewerPreferences(PdfWriter.HideToolbar);

Is there anyway around this?

From: PaulH **AdobeCommunityExpert** on
iborsb wrote:
> I get the following problem when trying to use the refactored iText 1.4.6.
>
> Class coldfusion.runtime.java.JavaProxy can not access a member of class
> com.lowagie.textNew.pdf.PdfWriter with modifiers "protected"
>
> Im trying to call the following function.
> pdfWriter.setViewerPreferences(PdfWriter.HideToolbar);
>
> Is there anyway around this?

short of doing some java wrappers, nope. it's the "protected" bit.


From: iborsb on
Thanks Paul

I'm looking at trying to make it harder for a user to either alter, save or
print a PDF. One way seemed to be through setting viewerpreferences and
removing all the tool bars. The other way is to set permissions and not allow
printing.

Have you any examples of how to do this?

From: PaulH **AdobeCommunityExpert** on
iborsb wrote:
> I'm looking at trying to make it harder for a user to either alter, save or
> print a PDF. One way seemed to be through setting viewerpreferences and
> removing all the tool bars. The other way is to set permissions and not allow
> printing.
>
> Have you any examples of how to do this?

no, not offhand but you *can* either set user permissions when you create the
doc via PdfWriter setEncryption method or read in an existing PDF & "stamp"
encryption on it via PdfStamper setEncryption method (or use PdfEncryptor class
encrypt method). note that for all these methods you'll need to add a password
to the PDF.

From: iborsb on
Hi Paul

I've come up with the following

newPDF=createObject("java","java.io.FileOutputStream").init(expandPath(finalOutP
utFile));
pdfStamper=createObject("java","com.lowagie.textNew.pdf.PdfStamper");
newPDF=pdfStamper.setEncryption('','',AllowPrinting,0);

Is that even close? Currently, I get an AllowPrinting is undefined error.

The notes suggest that the command should accept an int and yet the options
inlude allowprinting etc..


 |  Next  |  Last
Pages: 1 2 3
Prev: print
Next: geoLocator