The openProtection seems to be missing from PDFBox 2.x, so how can I do it
using that version, please?

On Tue, Nov 1, 2016 at 10:35 PM Keith R Wood <[email protected]> wrote:

> I added these two lines to my code where you said, and everything seems to
> be working for me now.
>
> StandardDecryptionMaterial dm = new StandardDecryptionMaterial("");
> doc.openProtection(dm);
>
> Thank you so much for the help!
>
> Thank you
> _____________________________________________________
> Keith Wood | Applications Program Lead | United Guaranty Corporation
> 300 N. Greene St. | Greensboro, NC 27401
>
> Phone: 336.334.8547
> [email protected]
> www.ugcorp.com
> ____________________________
>
>
> -----Original Message-----
> From: Tilman Hausherr [mailto:[email protected]]
> Sent: Tuesday, November 01, 2016 3:56 PM
> To: [email protected]
> Subject: Re: Using the .net version of PDFBox
>
> Am 28.10.2016 um 17:55 schrieb Keith R Wood:
> > I have gotten the .net port of PDFBox from here
> > http://www.squarepdf.net/pdfbox-net-1-8-7
> >
> > I'm not sure if it is proper to ask for support through this forum or
> not, but I thought I would ask in case someone has experience with this.
> >
> > I am attempting to remove the security from a PDF. Once I am through
> with the process I still have a valid PDF file, and the security is removed
> as expected. However, all thirty-six pages of the file are completely
> blank. I can do the same process with the same pdf using Java, and
> everything is okay with the file afterward (security removed and data
> present).
> >
> > I am using Miscrosoft Visual Studio 2013 .NET Framework 4.5.2
> >
> > Any suggestions or insights would be appreciated. Here is the relevant
> code:
> >
> >              //Now lets create the objects that will do the magic
> >              PDDocument doc = PDDocument.load(fileNameTemp);
>
> You should call openProtection() here.
>
> I'm surprised that this works in java, although I didn't test it.
>
> Could you upload the original, the result good and bad files?
>
> We don't do support for the .net versions (yours is an old one anyway),
> but maybe the PDFs will give some clue.
>
> Tilman
>
> >              AccessPermission ap = new AccessPermission();
> >
> >              //Lets set the permission to what we want
> >              ap.setCanExtractContent(true);
> >              ap.setCanExtractForAccessibility(true);
> >
> >              //Lets set the protection and apply it to our PDF
> >              StandardProtectionPolicy spp = new
> StandardProtectionPolicy("secretpassword", "", ap);
> >              doc.protect(spp);
> >              doc.save(fileNameTemp);
> >              doc.close();
>
>
>
> >
> > Thank you
> > _____________________________________________________
> > Keith Wood | Applications Program Lead | United Guaranty Corporation
> > 300 N. Greene St. | Greensboro, NC 27401
> >
> > Phone: 336.334.8547
> > [email protected]<mailto:[email protected]>
> > www.ugcorp.com<http://www.ugcorp.com/>
> > ____________________________
> >
> > ----------------------------------------------------------------------
> > ----------------------------------------------------------------------
> > ---- United Guaranty is a marketing term for United Guaranty
> > Corporation and its subsidiaries. This communication from United
> Guaranty Corporation or its subsidiary is directed to and is for the use of
> the individual or entity to which it is addressed. It may contain
> information that is confidential and exempt from disclosure under
> applicable law. If you are not the intended recipient, you are hereby
> notified that any distribution, dissemination, or copy of this
> communication is strictly prohibited. If you have received this
> communication in error, please contact the sender immediately, and then
> delete or destroy the material in its entirety. United Guaranty Corporation
> and its subsidiaries
> >   230 North Elm Street
> >   Greensboro, NC 27401
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ----------------------------------------------------------------------
> --------------------------------------------------------------------------
> United Guaranty is a marketing term for United Guaranty Corporation and
> its subsidiaries. This communication from United Guaranty Corporation or
> its subsidiary is directed to and is for the use of the individual or
> entity to which it is addressed. It may contain information that is
> confidential and exempt from disclosure under applicable law. If you are
> not the intended recipient, you are hereby notified that any distribution,
> dissemination, or copy of this communication is strictly prohibited. If you
> have received this communication in error, please contact the sender
> immediately, and then delete or destroy the material in its entirety.
> United Guaranty Corporation and its subsidiaries
>  230 North Elm Street
>  Greensboro, NC 27401
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to