pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Using the .net version of PDFBox
Date Tue, 01 Nov 2016 19:56:08 GMT
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.


>              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
> woodkr@ugcorp.com<mailto:pamela.davidson@ugcorp.com>
> 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: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org

View raw message