Print Page | Close Window

get/set standard fonts in the pdf

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2250
Printed Date: 23 Nov 24 at 4:18AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: get/set standard fonts in the pdf
Posted By: toran
Subject: get/set standard fonts in the pdf
Date Posted: 30 Apr 12 at 2:56AM
I have couple of questions related to font handling.
 
Q#1:
I am unsure how to identify the standard fonts in existing pdf document
 
My pseudocode looks lik this: (c#)
 
selectDocument(mydocid);
int iFontCount = FindFonts();
for (int i = 1; i <= iFontCount; ++i)
{
      int fontid = getFontId(i)
      selectFont(fontid);
 
      // here I would like to know if the the font that I just selected belongs to the
      // standard font as they are described in "AddStandardFont" function
      // ?
}
 
Q#2:
following two lines in respect to the same selected document
int fid1 = AddStandardFont(4);
int fid4 = AddStandardFont(4);
produce two different font ids. I would expect that subsequent addition of a standard font should
return the id of the previously added font. Am I wong here?
 
Thanks



Replies:
Posted By: Ingo
Date Posted: 30 Apr 12 at 8:17AM
Hi Toran!

Before the loop you have to call ONE TIME FindFonts to get all used fonts.
The next step is FontCount for your loop.
With GetFontID you'll get the ID of the selected font in your loop.
With FontName and (for example) FontType you'll get name and type of the selected font in your loop.
Here you'll find all font-related functions:
http://www.quickpdflibrary.com/help/quickpdf/Fonts.php

Cheers, Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk