You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Sharki Chacko <sh...@gmail.com> on 2015/12/02 18:10:32 UTC

Re: Question on working with encrypted PDF file using PDFBox

>
> Hi
>
> I have an encrypted PDF file without a password. The
> statement, (PDPage)_document.getDocumentCatalog().getAllPages() returns
> null because of that. I just want to know what else I can try to get the
> pages of the encrypted PDF file?
>
> Thanks,
> Sharki
>

Re: Question on working with encrypted PDF file using PDFBox

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 03.12.2015 um 17:46 schrieb Sharki Chacko:
> I am using IKVM dlls with PDFBox dll (
> http://www.squarepdf.net/how-to-convert-pdf-to-text-in-net). How to
> configure Bouncy Castle in that case?

Sorry, I don't know. That IKVM thing is nothing official, although one 
of the committers does use it too. PDFBox is a java product.



Tilman

>
> On Wed, Dec 2, 2015 at 6:30 PM, Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> You need bouncycastle:
>> http://pdfbox.apache.org/1.8/dependencies.html
>>
>> Tilman
>>
>>
>> Am 02.12.2015 um 19:00 schrieb Sharki Chacko:
>>
>>> Thanks! tried that code but got a "FileNotFound" exception.
>>>
>>> {"Could not load file or assembly 'bcprov-jdk15-1.44, Version=0.0.0.0,
>>> Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
>>> system cannot find the file specified.":"bcprov-jdk15-1.44,
>>> Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"}
>>>
>>> On Wed, Dec 2, 2015 at 12:44 PM, Tilman Hausherr <TH...@t-online.de>
>>> wrote:
>>>
>>> Am 02.12.2015 um 18:41 schrieb Sharki Chacko:
>>>> Version is 1.8.9.
>>>>> Here is the  method used to load document,
>>>>>
>>>>> public void OpenDocument(string path)
>>>>> {
>>>>> if (_document != null)
>>>>> {
>>>>> _document.close();
>>>>> }
>>>>> _document = PDDocument.load(path);
>>>>> }
>>>>>
>>>>> do this:
>>>> |if(||document.isEncrypted()){StandardDecryptionMaterialsdm
>>>> =newStandardDecryptionMaterial("");doc.openProtection(sdm);}|
>>>>
>>>>
>>>>
>>>> Tilman
>>>>
>>>>
>>>>
>>>>
>>>> Let me know if you have any other question.
>>>>> Thanks,
>>>>> Sharki
>>>>>
>>>>> On Wed, Dec 2, 2015 at 12:36 PM, Tilman Hausherr <THausherr@t-online.de
>>>>> wrote:
>>>>>
>>>>> What version are you using? What method are you using to load the file?
>>>>>
>>>>>> Tilman
>>>>>>
>>>>>>
>>>>>> Am 02.12.2015 um 18:10 schrieb Sharki Chacko:
>>>>>>
>>>>>> Hi
>>>>>>
>>>>>>> I have an encrypted PDF file without a password. The
>>>>>>>> statement, (PDPage)_document.getDocumentCatalog().getAllPages()
>>>>>>>> returns
>>>>>>>> null because of that. I just want to know what else I can try to get
>>>>>>>> the
>>>>>>>> pages of the encrypted PDF file?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Sharki
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Question on working with encrypted PDF file using PDFBox

Posted by Sharki Chacko <sh...@gmail.com>.
I am using IKVM dlls with PDFBox dll (
http://www.squarepdf.net/how-to-convert-pdf-to-text-in-net). How to
configure Bouncy Castle in that case?

On Wed, Dec 2, 2015 at 6:30 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> You need bouncycastle:
> http://pdfbox.apache.org/1.8/dependencies.html
>
> Tilman
>
>
> Am 02.12.2015 um 19:00 schrieb Sharki Chacko:
>
>> Thanks! tried that code but got a "FileNotFound" exception.
>>
>> {"Could not load file or assembly 'bcprov-jdk15-1.44, Version=0.0.0.0,
>> Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
>> system cannot find the file specified.":"bcprov-jdk15-1.44,
>> Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"}
>>
>> On Wed, Dec 2, 2015 at 12:44 PM, Tilman Hausherr <TH...@t-online.de>
>> wrote:
>>
>> Am 02.12.2015 um 18:41 schrieb Sharki Chacko:
>>>
>>> Version is 1.8.9.
>>>>
>>>> Here is the  method used to load document,
>>>>
>>>> public void OpenDocument(string path)
>>>> {
>>>> if (_document != null)
>>>> {
>>>> _document.close();
>>>> }
>>>> _document = PDDocument.load(path);
>>>> }
>>>>
>>>> do this:
>>>
>>> |if(||document.isEncrypted()){StandardDecryptionMaterialsdm
>>> =newStandardDecryptionMaterial("");doc.openProtection(sdm);}|
>>>
>>>
>>>
>>> Tilman
>>>
>>>
>>>
>>>
>>> Let me know if you have any other question.
>>>>
>>>> Thanks,
>>>> Sharki
>>>>
>>>> On Wed, Dec 2, 2015 at 12:36 PM, Tilman Hausherr <THausherr@t-online.de
>>>> >
>>>> wrote:
>>>>
>>>> What version are you using? What method are you using to load the file?
>>>>
>>>>> Tilman
>>>>>
>>>>>
>>>>> Am 02.12.2015 um 18:10 schrieb Sharki Chacko:
>>>>>
>>>>> Hi
>>>>>
>>>>>> I have an encrypted PDF file without a password. The
>>>>>>> statement, (PDPage)_document.getDocumentCatalog().getAllPages()
>>>>>>> returns
>>>>>>> null because of that. I just want to know what else I can try to get
>>>>>>> the
>>>>>>> pages of the encrypted PDF file?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Sharki
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>>
>>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: Question on working with encrypted PDF file using PDFBox

Posted by Tilman Hausherr <TH...@t-online.de>.
You need bouncycastle:
http://pdfbox.apache.org/1.8/dependencies.html

Tilman

Am 02.12.2015 um 19:00 schrieb Sharki Chacko:
> Thanks! tried that code but got a "FileNotFound" exception.
>
> {"Could not load file or assembly 'bcprov-jdk15-1.44, Version=0.0.0.0,
> Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
> system cannot find the file specified.":"bcprov-jdk15-1.44,
> Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"}
>
> On Wed, Dec 2, 2015 at 12:44 PM, Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> Am 02.12.2015 um 18:41 schrieb Sharki Chacko:
>>
>>> Version is 1.8.9.
>>>
>>> Here is the  method used to load document,
>>>
>>> public void OpenDocument(string path)
>>> {
>>> if (_document != null)
>>> {
>>> _document.close();
>>> }
>>> _document = PDDocument.load(path);
>>> }
>>>
>> do this:
>>
>> |if(||document.isEncrypted()){StandardDecryptionMaterialsdm
>> =newStandardDecryptionMaterial("");doc.openProtection(sdm);}|
>>
>>
>>
>> Tilman
>>
>>
>>
>>
>>> Let me know if you have any other question.
>>>
>>> Thanks,
>>> Sharki
>>>
>>> On Wed, Dec 2, 2015 at 12:36 PM, Tilman Hausherr <TH...@t-online.de>
>>> wrote:
>>>
>>> What version are you using? What method are you using to load the file?
>>>> Tilman
>>>>
>>>>
>>>> Am 02.12.2015 um 18:10 schrieb Sharki Chacko:
>>>>
>>>> Hi
>>>>>> I have an encrypted PDF file without a password. The
>>>>>> statement, (PDPage)_document.getDocumentCatalog().getAllPages() returns
>>>>>> null because of that. I just want to know what else I can try to get
>>>>>> the
>>>>>> pages of the encrypted PDF file?
>>>>>>
>>>>>> Thanks,
>>>>>> Sharki
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>
>>>>
>>>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Question on working with encrypted PDF file using PDFBox

Posted by Sharki Chacko <sh...@gmail.com>.
Thanks! tried that code but got a "FileNotFound" exception.

{"Could not load file or assembly 'bcprov-jdk15-1.44, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified.":"bcprov-jdk15-1.44,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"}

On Wed, Dec 2, 2015 at 12:44 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> Am 02.12.2015 um 18:41 schrieb Sharki Chacko:
>
>> Version is 1.8.9.
>>
>> Here is the  method used to load document,
>>
>> public void OpenDocument(string path)
>> {
>> if (_document != null)
>> {
>> _document.close();
>> }
>> _document = PDDocument.load(path);
>> }
>>
>
> do this:
>
> |if(||document.isEncrypted()){StandardDecryptionMaterialsdm
> =newStandardDecryptionMaterial("");doc.openProtection(sdm);}|
>
>
>
> Tilman
>
>
>
>
>> Let me know if you have any other question.
>>
>> Thanks,
>> Sharki
>>
>> On Wed, Dec 2, 2015 at 12:36 PM, Tilman Hausherr <TH...@t-online.de>
>> wrote:
>>
>> What version are you using? What method are you using to load the file?
>>>
>>> Tilman
>>>
>>>
>>> Am 02.12.2015 um 18:10 schrieb Sharki Chacko:
>>>
>>> Hi
>>>>
>>>>> I have an encrypted PDF file without a password. The
>>>>> statement, (PDPage)_document.getDocumentCatalog().getAllPages() returns
>>>>> null because of that. I just want to know what else I can try to get
>>>>> the
>>>>> pages of the encrypted PDF file?
>>>>>
>>>>> Thanks,
>>>>> Sharki
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>>
>>>
>

Re: Question on working with encrypted PDF file using PDFBox

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 02.12.2015 um 18:41 schrieb Sharki Chacko:
> Version is 1.8.9.
>
> Here is the  method used to load document,
>
> public void OpenDocument(string path)
> {
> if (_document != null)
> {
> _document.close();
> }
> _document = PDDocument.load(path);
> }

do this:

|if(||document.isEncrypted()){StandardDecryptionMaterialsdm 
=newStandardDecryptionMaterial("");doc.openProtection(sdm);}|



Tilman


>
> Let me know if you have any other question.
>
> Thanks,
> Sharki
>
> On Wed, Dec 2, 2015 at 12:36 PM, Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> What version are you using? What method are you using to load the file?
>>
>> Tilman
>>
>>
>> Am 02.12.2015 um 18:10 schrieb Sharki Chacko:
>>
>>> Hi
>>>> I have an encrypted PDF file without a password. The
>>>> statement, (PDPage)_document.getDocumentCatalog().getAllPages() returns
>>>> null because of that. I just want to know what else I can try to get the
>>>> pages of the encrypted PDF file?
>>>>
>>>> Thanks,
>>>> Sharki
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>


Re: Question on working with encrypted PDF file using PDFBox

Posted by Sharki Chacko <sh...@gmail.com>.
Version is 1.8.9.

Here is the  method used to load document,

public void OpenDocument(string path)
{
if (_document != null)
{
_document.close();
}
_document = PDDocument.load(path);
}

Let me know if you have any other question.

Thanks,
Sharki

On Wed, Dec 2, 2015 at 12:36 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> What version are you using? What method are you using to load the file?
>
> Tilman
>
>
> Am 02.12.2015 um 18:10 schrieb Sharki Chacko:
>
>> Hi
>>>
>>> I have an encrypted PDF file without a password. The
>>> statement, (PDPage)_document.getDocumentCatalog().getAllPages() returns
>>> null because of that. I just want to know what else I can try to get the
>>> pages of the encrypted PDF file?
>>>
>>> Thanks,
>>> Sharki
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: Question on working with encrypted PDF file using PDFBox

Posted by Tilman Hausherr <TH...@t-online.de>.
What version are you using? What method are you using to load the file?

Tilman

Am 02.12.2015 um 18:10 schrieb Sharki Chacko:
>> Hi
>>
>> I have an encrypted PDF file without a password. The
>> statement, (PDPage)_document.getDocumentCatalog().getAllPages() returns
>> null because of that. I just want to know what else I can try to get the
>> pages of the encrypted PDF file?
>>
>> Thanks,
>> Sharki
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Question on working with encrypted PDF file using PDFBox

Posted by Gilad Denneboom <gi...@gmail.com>.
You have to decrypt it first... If can specify the password as the second
parameter of the load method of PDDocument.

On Wed, Dec 2, 2015 at 6:10 PM, Sharki Chacko <sh...@gmail.com>
wrote:

> >
> > Hi
> >
> > I have an encrypted PDF file without a password. The
> > statement, (PDPage)_document.getDocumentCatalog().getAllPages() returns
> > null because of that. I just want to know what else I can try to get the
> > pages of the encrypted PDF file?
> >
> > Thanks,
> > Sharki
> >
>