New Forum | Previous | Next | (P-PDF) Developers
Topic: can I work with PDEFont using VB?
Conf: (P-PDF) Developers, Msg: 101127
Date: 11/21/2003 11:40 AM
I'm looking to get a string width in EM units which it looks like I can do with PDEFontSumWidths (5.0 SDK).
I assume I need to PDEFontCreate and then access PDEFont methods accordingly. Can I do the following in VB and if so, how? (from the sdk samples):
PDEFont pdeFont = NULL;
memset(&pdeFontAttrs, 0, sizeof(pdeFontAttrs));
pdeFontAttrs.name = ASAtomFromString("Times-Roman");
pdeFontAttrs.type = ASAtomFromString("Type1");
// Create the font reference.
pdeFont = PDEFontCreate(&pdeFontAttrs, sizeof(pdeFontAttrs), 0, 255, 0, 0, ASAtomNull, 0, 0, 0, 0);
ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
Then I'd like to do something like this in VB:
// get the string width in EM units
widthEMUnits As Integer
stringToMeasure As String
widthEMUnits = PDEFontSumWidths (pdeFont, stringToMeasure, len(stringToMeasure))
Is this correct?
Finally, do I need a PDF document in order to use PDEFont or can I generate a PDEFont in memory and query it?
Thanks for the help.