pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karthick g <ikarthick2...@gmail.com>
Subject Re: Linearized dictionary
Date Mon, 22 May 2017 04:17:43 GMT
Hi team,

Here is the code, I am using COSName.getPDFName("Linearized). The problem
is

PDDocument pdDoc = PDDocument.load(new File(""));
COSDocument cosDoc = pdDoc.getDocument();
List<?> lObj = cosDoc.getObjects();
            for (Object object : lObj) {

                COSBase curObj = ((COSObject) object).getObject();
                if (curObj instanceof COSDictionary) {

                    COSDictionary cOSDictionary = (COSDictionary) curObj;

                    if
(cOSDictionary.keySet().contains(COSName.getPDFName("Linearized"))) {
                        //System.out.println("Linearized");
                    }
                }
            }

While using 1.8.2 Linearized is working properly. But in 2.0.5 I can not
get the linearized and I can't check the linearized as it is not in the
dictionary keyset. Please let me know if you need more details.




Regards,
Karthick G

On Fri, May 19, 2017 at 9:27 AM, karthick g <ikarthick2002@gmail.com> wrote:

> Hi,
> * I need to Check whether my PDF file is Linearized or not, for fast view
> web. *
> In the previous version (1.8.2) of PDFBox Linearized is in the COSName. I
> will get the COSDictionary and check whether Linearized is available in the
> COSName and conclude the PDF is suited for fast web view. Now Linearized
> keyword is not in
> the List of COSName. How can I get the Linearized dictionary in PDFBox.
> Please let me know if you need more details.
>
> Regards,
> Karthick G
>
>
>
> On Thu, May 18, 2017 at 9:17 AM, karthick g <ikarthick2002@gmail.com>
> wrote:
>
>> Hi team,
>>
>> I am a long time user of PDFBox. We starts to migrate pdfbox from 1.8.2
>> to 2.0.5.
>> During migration I found that Linearized dictionary moved to preflight
>> jar.
>> I created the PDDocument based on preflight context which is returning
>> null.
>> Since the PDDocument is null I can't proceed further. What is the right
>> way to
>> get Lineraized dictionary in the current version of PDFBox . Please guide
>> me.
>> Please let me know if you need more details.
>>
>> Regards,
>> Karthick G
>>
>>
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message