You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Ramesh Shrestha <ra...@gmail.com> on 2015/09/11 08:42:07 UTC

How to identify PDF Portfolio?

Hi,

Is it possible to identify whether PDF is PDF Portfolio or not?

Thanks,
Ramesh

Re: How to identify PDF Portfolio?

Posted by Ramesh Shrestha <ra...@gmail.com>.
Thanks Maruan,

After testing with various PDF it is working as expected so will be using
it to identify PDF Portfolio.

Regards,
Ramesh

On Fri, Sep 11, 2015 at 1:51 PM, Maruan Sahyoun <sa...@fileaffairs.de>
wrote:

> Hi,
>
> > Am 11.09.2015 um 10:02 schrieb Ramesh Shrestha <ra...@gmail.com>:
> >
> > Hi
> >
> > I have tried this
> >
> >
> > *   PDDocument pdfDocument = new PDDocument();*
> > *   pdfDocument = PDDocument.load(inputPDF);*
> > *   PDDocumentCatalog cat = pdfDocument.getDocumentCatalog();*
> > *   COSDictionary dict = cat.getCOSDictionary();*
> > *   bool isCollection = dict.containsKey("Collection");*
>
> I was just about sending you the same information - glad you already found
> it. There is no high level API (pdmodel) currently in PDFBox for
> Collections so you need the COS level to deal with collections.
>
> BR
> Maruan
>
> >
> > and it seems to be working as it returns isCollection=true for portfolio
> > and isCollection=false for nomal PDF.
> >
> > Now will test for various PDF and see if it can be used to identify PDF
> > Portfolio or not.
> >
> > Thanks,
> > Ramesh
> >
> > On Fri, Sep 11, 2015 at 1:36 PM, Ramesh Shrestha <ra...@gmail.com>
> > wrote:
> >
> >> Hi
> >>
> >> I have tried following code snippet
> >>
> >>
> >> *    PDDocument pdfDocument = new PDDocument();*
> >> *    pdfDocument = PDDocument.load(inputPDF);*
> >> *    PDDocumentCatalog cat = pdfDocument.getDocumentCatalog();*
> >>
> >> But I am not able to find /Collection entry. Can you help me to find
> that
> >> entry?
> >>
> >> Thanks
> >> Ramesh
> >>
> >> On Fri, Sep 11, 2015 at 1:06 PM, Maruan Sahyoun <sahyoun@fileaffairs.de
> >
> >> wrote:
> >>
> >>> Hi,
> >>>
> >>>> Am 11.09.2015 um 08:42 schrieb Ramesh Shrestha <rameshpasa@gmail.com
> >:
> >>>>
> >>>> Hi,
> >>>>
> >>>> Is it possible to identify whether PDF is PDF Portfolio or not?
> >>>>
> >>>
> >>> you could check if the Document Catalog dictionary contains a
> /Collection
> >>> entry.
> >>>
> >>> BR
> >>> Maruan
> >>>
> >>>
> >>>> Thanks,
> >>>> Ramesh
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >>> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>>
> >>>
> >>
> >>
> >> --
> >> pasa
> >>
> >
> >
> >
> > --
> > pasa
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: How to identify PDF Portfolio?

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,

> Am 11.09.2015 um 10:02 schrieb Ramesh Shrestha <ra...@gmail.com>:
> 
> Hi
> 
> I have tried this
> 
> 
> *   PDDocument pdfDocument = new PDDocument();*
> *   pdfDocument = PDDocument.load(inputPDF);*
> *   PDDocumentCatalog cat = pdfDocument.getDocumentCatalog();*
> *   COSDictionary dict = cat.getCOSDictionary();*
> *   bool isCollection = dict.containsKey("Collection");*

I was just about sending you the same information - glad you already found it. There is no high level API (pdmodel) currently in PDFBox for Collections so you need the COS level to deal with collections.

BR
Maruan

> 
> and it seems to be working as it returns isCollection=true for portfolio
> and isCollection=false for nomal PDF.
> 
> Now will test for various PDF and see if it can be used to identify PDF
> Portfolio or not.
> 
> Thanks,
> Ramesh
> 
> On Fri, Sep 11, 2015 at 1:36 PM, Ramesh Shrestha <ra...@gmail.com>
> wrote:
> 
>> Hi
>> 
>> I have tried following code snippet
>> 
>> 
>> *    PDDocument pdfDocument = new PDDocument();*
>> *    pdfDocument = PDDocument.load(inputPDF);*
>> *    PDDocumentCatalog cat = pdfDocument.getDocumentCatalog();*
>> 
>> But I am not able to find /Collection entry. Can you help me to find that
>> entry?
>> 
>> Thanks
>> Ramesh
>> 
>> On Fri, Sep 11, 2015 at 1:06 PM, Maruan Sahyoun <sa...@fileaffairs.de>
>> wrote:
>> 
>>> Hi,
>>> 
>>>> Am 11.09.2015 um 08:42 schrieb Ramesh Shrestha <ra...@gmail.com>:
>>>> 
>>>> Hi,
>>>> 
>>>> Is it possible to identify whether PDF is PDF Portfolio or not?
>>>> 
>>> 
>>> you could check if the Document Catalog dictionary contains a /Collection
>>> entry.
>>> 
>>> BR
>>> Maruan
>>> 
>>> 
>>>> Thanks,
>>>> Ramesh
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>> 
>>> 
>> 
>> 
>> --
>> pasa
>> 
> 
> 
> 
> -- 
> pasa


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


Re: How to identify PDF Portfolio?

Posted by Ramesh Shrestha <ra...@gmail.com>.
Hi

I have tried this


*   PDDocument pdfDocument = new PDDocument();*
*   pdfDocument = PDDocument.load(inputPDF);*
*   PDDocumentCatalog cat = pdfDocument.getDocumentCatalog();*
*   COSDictionary dict = cat.getCOSDictionary();*
*   bool isCollection = dict.containsKey("Collection");*

and it seems to be working as it returns isCollection=true for portfolio
and isCollection=false for nomal PDF.

Now will test for various PDF and see if it can be used to identify PDF
Portfolio or not.

Thanks,
Ramesh

On Fri, Sep 11, 2015 at 1:36 PM, Ramesh Shrestha <ra...@gmail.com>
wrote:

> Hi
>
> I have tried following code snippet
>
>
> *    PDDocument pdfDocument = new PDDocument();*
> *    pdfDocument = PDDocument.load(inputPDF);*
> *    PDDocumentCatalog cat = pdfDocument.getDocumentCatalog();*
>
> But I am not able to find /Collection entry. Can you help me to find that
> entry?
>
> Thanks
> Ramesh
>
> On Fri, Sep 11, 2015 at 1:06 PM, Maruan Sahyoun <sa...@fileaffairs.de>
> wrote:
>
>> Hi,
>>
>> > Am 11.09.2015 um 08:42 schrieb Ramesh Shrestha <ra...@gmail.com>:
>> >
>> > Hi,
>> >
>> > Is it possible to identify whether PDF is PDF Portfolio or not?
>> >
>>
>> you could check if the Document Catalog dictionary contains a /Collection
>> entry.
>>
>> BR
>> Maruan
>>
>>
>> > Thanks,
>> > Ramesh
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
>
>
> --
> pasa
>



-- 
pasa

Re: How to identify PDF Portfolio?

Posted by Ramesh Shrestha <ra...@gmail.com>.
Hi

I have tried following code snippet


*    PDDocument pdfDocument = new PDDocument();*
*    pdfDocument = PDDocument.load(inputPDF);*
*    PDDocumentCatalog cat = pdfDocument.getDocumentCatalog();*

But I am not able to find /Collection entry. Can you help me to find that
entry?

Thanks
Ramesh

On Fri, Sep 11, 2015 at 1:06 PM, Maruan Sahyoun <sa...@fileaffairs.de>
wrote:

> Hi,
>
> > Am 11.09.2015 um 08:42 schrieb Ramesh Shrestha <ra...@gmail.com>:
> >
> > Hi,
> >
> > Is it possible to identify whether PDF is PDF Portfolio or not?
> >
>
> you could check if the Document Catalog dictionary contains a /Collection
> entry.
>
> BR
> Maruan
>
>
> > Thanks,
> > Ramesh
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>


-- 
pasa

Re: How to identify PDF Portfolio?

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,

> Am 11.09.2015 um 08:42 schrieb Ramesh Shrestha <ra...@gmail.com>:
> 
> Hi,
> 
> Is it possible to identify whether PDF is PDF Portfolio or not?
> 

you could check if the Document Catalog dictionary contains a /Collection entry.

BR
Maruan


> Thanks,
> Ramesh


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