Am 12.01.2016 um 10:07 schrieb ????????:
Hello:
Recently the pdfbox demo, when PrintTextLocations about writeString () method,
this TextPosition how to create how to transfer can provide a demo? thank you
Hello ????????,
Your text is almost impossible to understand, but I suspect you are
asking about a recent post of mine where I explained that writeString
can be overridden. There is no demo for 1.8, but you can modify the
PrintTextLocations example by adding this:
protected void writeString(String string, List<TextPosition>
textPositions) throws IOException
{
for (TextPosition text : textPositions)
{
System.out.println( "String[" + text.getXDirAdj() + "," +
text.getYDirAdj() + " fs=" + text.getFontSize() + "
xscale=" +
text.getXScale() + " height=" + text.getHeightDir() + "
space=" +
text.getWidthOfSpace() + " width=" +
text.getWidthDirAdj() + "]" + text.getCharacter() );
}
}
and remove processTextPosition().
In 2.0 you can use PrintTextLocations or DrawPrintTextLocations directly.
Or is your question how to get the examples to run? The easiest way is
from your IDE, configure it to use that class as main, and don't forget
to configure the parameters. Another way is to change the source to
assign the parameters to the "args" variable and then do "run file":
args = new String[]{"path"};
Or create a new project, and copy the sample class into it.
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]