You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by karthick g <ik...@gmail.com> on 2011/05/18 11:35:34 UTC

PDFBox page number with junk values

Hi all ,

* I am very long time user of PDFBOX from 0.7.3 version.

* Current I am using the latest version(1.5.0)

*While extracting  pdf page number by using PDFPageLabel , I found that Junk
values attached with the Last page number

*We fix the problem by using java trim method is their any other way to
solve the problem


Code:
-----
  *pd =PDDocument.load(new File("/home/imran/main.pdf"));  **

  PDDocumentCatalog cat = pd.getDocumentCatalog();

    String[] labels = cat.getPageLabels().getLabelsByPageIndices();

   System.out.println(labels[0]);

   System.out.println(labels[labels.length - 1] + "Hi");*


While printing last page  with  "Hi" it will print just the Last page number
with junk values and "Hi" is not printed .

I*n order to cut the junk values we used Trim() in java*.

Kindly guide me in this issue .


Here by i attached sample  PDF with this mail .

Thank You very much

Regards

Karthick G