1. Please reply to the mailing list, not to me personally.
2. I wrote the sample *from memory* and I forgot to cast
 the PdfObject to a PdfDictionary (which is a subclass of
 PdfObject).
br,
Bruno

Selvi K wrote:

//this the the code i complied and guide me how to clear the error

package

samples.reading;

import

java.io.IOException;

import

com.lowagie.text.pdf.PdfDictionary;

import

com.lowagie.text.pdf.PdfName;

//import com.lowagie.text.pdf.PdfObject;

import

com.lowagie.text.pdf.PdfReader;

public

class FindFontName1 { public static void main(String[] args) { try {

PdfReader reader =

new PdfReader("aa.pdf");

PdfDictionary catalog = reader.getCatalog();

PdfDictionary pagelabels = catalog.get(PdfName.PAGELABELS);

/*PdfDictionary dic2 = (PdfDictionary)reader.getPdfObject(1);

PdfObject fontReal = dic2.get(PdfName.BASEFONT);

System.out.println("Font Name : "+fontReal);

System.out.println("Font Encoding : "+dic2.get(PdfName.ENCODING));

System.out.println("Author : "+dic2.get(PdfName.AUTHOR));

System.out.println("Type : "+ dic2.get(PdfName.SUBTYPE));*/

}

catch (IOException ioe)

{

System.err.println(ioe.getMessage());

}

}

}

iam getting this error when compiling the above code.iam sending the folder folder in which the jarfile iam using is present and the code

C:\PDFGenerater\src>javac samples\reading\FindFontName1.java
samples\reading\FindFontName1.java:16: incompatible types
found   : com.lowagie.text.pdf.PdfObject
required: com.lowagie.text.pdf.PdfDictionary
PdfDictionary pagelabels = catalog.get(PdfName.PAGELABE
LS);
                                                               ^
1 error

On 4/7/06, *bruno* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Selvi K wrote:

    >
    > how can i read the page labels of a pdffile and test it for its
    > uniqueness using itext.iam using windows 2000.
    > --
    > selvi.k

    You would need something like this:
    PdfReader reader = new PdfReader("my.pdf");
    PdfDictionary catalog = reader.getCatalog();
    PdfDictionary pagelabels = catalog.get(PdfName.PAGELABELS);
    This will give you a PdfDictionary with key-value pairs
    that contain all the info on the page labels
    (see section 8.3.1 of the PDF Reference).
    br,
    Bruno




--
selvi.k




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to