pdfGetWordSpaceAfter
Check for a space after a word.
int pdfGetWordSpaceAfter(PDFWordHandle word)
This function returns true (non-zero) if there is a space after the
specified word (whose handle was obtained with
pdfGetWord
).
Words are usually split at spaces,
so pdfGetWordSpaceAfter
usually returns true. Some
situations where it can return false are:
- There is no space between a word and a following superscript or subscript.
- XpdfText splits words if the font, font size, or color changes.
- A hyphenated word at the end of a line will not have a space after it.
C:
PDFWordHandle word;
char *fontName;
double fontSize;
int bold, italic, fixedWidth, serif, symbolic;
double r, g, b;
double xMin, yMin, xMax, yMax;
int space, rot;
pdfBuildWordList(pdf, 1);
for (i = 0; i < pdfGetNumWords(pdf); ++i) {
word = pdfGetWord(pdf, i);
fontName = pdfGetWordFontName(word);
fontSize = pdfGetWordFontSize(word);
bold = pdfGetWordFontIsBold(word);
italic = pdfGetWordFontIsItalic(word);
fixedWidth = pdfGetWordFontIsFixedWidth(word);
serif = pdfGetWordFontIsSerif(word);
symbolic = pdfGetWordFontIsSymbolic(word);
pdfGetWordColor(word, &r, &g, &b);
pdfGetWordBox(word, &xMin, &yMin, &xMax, &yMax);
space = pdfGetWordSpaceAfter(word);
rot = pdfGetWordRotation(word);
...
}
pdfBuildWordList
pdfGetNumWords
pdfGetWord
pdfGetWordText
pdfGetWordLength
pdfGetWordFontName
pdfGetWordColor
pdfGetWordBox
pdfGetWordBox2
pdfGetWordCharBox
pdfGetWordCharBox2
pdfGetWordFontSize
pdfGetWordFontIsFixedWidth
pdfGetWordFontIsSerif
pdfGetWordFontIsSymbolic
pdfGetWordFontIsBold
pdfGetWordFontIsItalic
pdfGetWordRotation
pdfGetWordCharPos
pdfGetWordCharLen