Using: LIBHARU 2.08 PDF library; available at http://libharu.sourceforge.net/
Function declaration from documentation:
My PB code so far:
From hPDF.h:
There is no 'apdf.h' file in the package.
What files / portions of files would I need to post for someone to tell me how that structure is returned? That is, how I can get the values from the returned structure in my PB/Win 8.03 program?
I thought HPDF_Font_textWidth might return a pointer to a structure - multiple calls always return the same value within any one run of the program, eg 1267862, which sure looks like a pointer - but that did not work out for me.
Anything worth a try appreciated. I can do what I need to do with what I have working but it is definitely going the long way and making this call work would simplify my life a lot.
Thanks,
MCM
Function declaration from documentation:
Code:
#include "apdf.h" typedef struct _HPDF_TextWidth { HPDF_UINT numchars; HPDF_UINT numwords; HPDF_UINT width; HPDF_UINT numspace; } HPDF_TextWidth; HPDF_TextWidth HPDF_Font_TextWidth (HPDF_Font font, const HPDF_BYTE *text, HPDF_UINT len);
Code:
TYPE HPDF_TEXT_WIDTH numchar AS LONG numWord AS LONG nwidth AS LONG nSpace AS LONG END TYPE ... DECLARE FUNCTION HPDF_Font_TextWidth libharu_call libharu_dll ALIAS "HPDF_Font_TextWidth" _ (BYVAL hFont AS LONG, szText AS ASCIIZ, BYVAL iLen AS LONG) AS LONG LOCAL pTW AS HPDF_TEXT_WIDTH PTR LOCAL TW AS HPDF_TEXT_WIDTH CALL HPDF_Font_TextWidth ( hFont(0), szText, LSTRLEN(szText)) TO pTW
Code:
HPDF_EXPORT(HPDF_TextWidth) HPDF_Font_TextWidth (HPDF_Font font, const HPDF_BYTE *text, HPDF_UINT len);
What files / portions of files would I need to post for someone to tell me how that structure is returned? That is, how I can get the values from the returned structure in my PB/Win 8.03 program?
I thought HPDF_Font_textWidth might return a pointer to a structure - multiple calls always return the same value within any one run of the program, eg 1267862, which sure looks like a pointer - but that did not work out for me.
Anything worth a try appreciated. I can do what I need to do with what I have working but it is definitely going the long way and making this call work would simplify my life a lot.
Thanks,
MCM
Comment