Fonts-Attribute always empty

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
ThomasUttendorfer
Posts: 5
Joined: Fri Dec 02 2016

Fonts-Attribute always empty

Post by ThomasUttendorfer »

Hi,
I use Amyuni Creator V6.5 (Evaluation):
When I open a pdf document and want to know the fonts used in the document I always get an empty array.
But when I open the same document with Amyuni PDF Creator User Interface (PDFCreactiveDoc.exe)
and look at Document Settings / Fonts there are some fonts listed.
Fonts.png
Fonts.png (3.57 KiB) Viewed 3213 times
What am I doing wrong?
Here is my code in C#.

Code: Select all

            PDFCreactiveX pdf = new PDFCreactiveX();
            pdf.SetLicenseKey(PDF_V65_Company, PDF_V65_LicenseKey);
            ret = pdf.Open(filename, password);
            if(ret > 0)
            {
                var doc = pdf.Document;
                var fonts = doc["Fonts"];
// 		fonts is always an empty array. ({Object[0]} 
            }
Regards Thomas
ThomasUttendorfer
Posts: 5
Joined: Fri Dec 02 2016

Re: Fonts-Attribute always empty

Post by ThomasUttendorfer »

Found out that one has first to set a CurrentPage:

Code: Select all

            PDFCreactiveX pdf = new PDFCreactiveX();
            pdf.SetLicenseKey(PDF_V65_Company, PDF_V65_LicenseKey);
            ret = pdf.Open(filename, password);
            if(ret > 0)
            {
                pdf.CurrentPage = 1; // this one is important
                var doc = pdf.Document;
                var fonts = doc["Fonts"];
            }
Post Reply