Question

I'm trying to print a large string to alivepdf. I'm splitting the string by its newlines into an array, and then printing each separate element in a loop.

The problem I'm running into is when a long string is printed in alivepdf, writeText() will word-wrap and go to a new line (based on the first argument). If the string word-wraps more than twice, the next element in the array will be printed over the last bit of the word-wrapped string during the next iteration.

Is it possible to extract the current y-value after a string has been wordwrapped? Or perhaps return the amount of times a string will be word-wrapped? My margins are set to 20. Thanks!

var noteLines:Array = noteText.text.split('\r');
for each (var line:String in noteLines) {
    y += 10;
    printPDF.setXY(x, y);
    printPDF.writeText(5, line);    
}
Was it helpful?

Solution

Here is code for get current y position of pdf.

printPDF.getY()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top