Open GoogleCodeExporter opened 9 years ago
Got exactly the same Error while trying to compose a huge table with these
lines:
(widths:Array of numbers)
(table:SimpleTable)
var pdt:PdfPTable = table.createPdfPTable();
pdt.setNumberWidths(Vector.<Number>(widths));
pdfDocument.add(pdt);
Original comment by pcfan.s...@gmail.com
on 13 Oct 2010 at 7:04
P.S.
Got the same with pdfDocument.add(table) with the same context like my first
comment.
Both methods worked with a smaller test table.
Original comment by pcfan.s...@gmail.com
on 13 Oct 2010 at 7:10
Think I've got it.
The text I want to render contains local characters (diacritics) and the fonts
used by purePdf can't interpret such characters. After a few pre-processing
(excluding the diacritics from the text) everything went ok.
Original comment by pcfan.s...@gmail.com
on 13 Oct 2010 at 10:22
The user that reported the problem is brazilian and he might have had some
non-standard characters. Any ideas on how to fix it so it supports non standard
characters?
Original comment by trent.we...@gmail.com
on 13 Oct 2010 at 4:11
Here is the solution to the problem. This is line 398 of the BaseFont.as. I
randomly chose code 125 so that might be wrong but it seems to work fine. It
just removes the invalid character which in this case was 8806. A greater then
or equal to character.
protected function _getWidthI( code: int ): int
{
if ( fastWinansi )
{
if ( code < 128 || ( code >= 160 && code <= 255 ) ) {
return widths[ code ];
} else {
if (PdfEncodings.winansi[ code ]!= undefined) {
return widths[ PdfEncodings.winansi[ code ] ];
} else {
return widths[125];
}
}
} else {
.............
Original comment by trent.we...@gmail.com
on 15 Oct 2010 at 10:27
Can you provide a sample project to reproduce this error?
Original comment by alessand...@gmail.com
on 14 Jan 2011 at 11:35
For example "Hello World" with local characters generate this error:
...
createDocument( "Hello World" );
document.open();
document.add( new Paragraph("Widzew Łódź ęółśążźćń
ĘÓŁŚĄŻŹĆŃ") );
document.close();
...
Original comment by anal...@bly.pl
on 9 Aug 2011 at 11:30
Original issue reported on code.google.com by
trent.we...@gmail.com
on 6 Oct 2010 at 3:52