« Return to Thread: 128-bit encryption, no owner password
Paulo Soares wrote:That's a legal imposition from Adobe. You must have the owner password.
Paulo
> -----Original Message-----
> From: itextsharp-questions-bounces@lists.sourceforge.net
> [mailto:itextsharp-questions-bounces@lists.sourceforge.net]
> On Behalf Of IT_Hank
> Sent: Tuesday, May 13, 2008 4:00 PM
> To: itextsharp-questions@lists.sourceforge.net
> Subject: [itextsharp-questions] 128-bit encryption, no owner password
>
>
> We have an application that is creating a 128-bit encrypted
> PDF without user
> or owner passwords. When performing a PdfCopy.GetImportPage
> method call,
> the GetImportPage method fails in version 4.1.1.0. This
> worked in version
> 3.1.6.0.
>
> The error might stem from the following:
>
> //this is the error being thrown because false is being returend from
> "IsOpenedWillFullPermissions".
>
> internal PdfImportedPage GetImportedPage(int pageNumber) {
> if (!reader.IsOpenedWithFullPermissions)
> throw new ArgumentException("PdfReader not
> opened with owner
> password");
>
> //this method returns false if encrypted and no password is supplied.
>
> public bool IsOpenedWithFullPermissions {
> get {
> return !encrypted || ownerPasswordUsed;
> }
> }
>
> //this is the calling code
> Snippet one...
> if (reportGuid != Guid.Empty)
> {
> SQLFileInfo inputInfo = new SQLFileInfo(reportGuid);
> using (SQLFileStream inputStream =
> inputInfo.Open(System.IO.FileMode.Open))
> {
> reader = new PdfReader(inputStream, null);
> if (copy == null)
> {
> doc = new Document(reader.GetPageSizeWithRotation(1));
> copy = new PdfCopy(doc, outputStream);
> doc.Open();
> }
> //copy the pages
> CopyPages(copy, reader);
> }
> }
>
> Snippet two...
> private void CopyPages(PdfCopy copy, PdfReader reader)
> {
> for (int i = 1; i <= reader.NumberOfPages; i++)
> {
> //This is where the error happens
> copy.AddPage(copy.GetImportedPage(reader, i));
> }
> }
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
« Return to Thread: 128-bit encryption, no owner password
| Free embeddable forum powered by Nabble | Forum Help |