Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
GetPageText trunc the text with unicode char 65533 |
Post Reply |
Author | |
bart_bender
Beginner Joined: 04 Oct 11 Location: Spain Status: Offline Points: 17 |
Post Options
Thanks(0)
Posted: 20 Oct 11 at 2:39PM |
Hello,
I'm extracting the Text from a PDF document with GetPageText method and this return a truncated text http://demos.sdm.es/marketing/images/doc.pdf The last char is 65533 unicode o 63 in ascii I'm using the DLL version in a vb .net proyect any idea? Thanks in advance Best regards |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Bart!
Where's the problem? I've extracted your form completely and it's all okay. I've removed the adress ... I've done it with version 7.26: FORMA DE PAGO: TRANSFERENCIA REF. DE PAGO : REF.: /001164/756661 NIF:A23453445 9364651 444,24 8 ESTERIL PL.1,5 160 1,870 299,20 0,967 144,48 PUNTO VERDE x 100 1,147 1,84 1,84 349 FRESA RACION PAK 6 4 5,180 20,72 2,608 10,29 PUNTO VERDE x 100 3,421 0,14 0,14 658 CACAOLAT SYS RAC 6 24 5,180 124,32 2,608 61,73 PUNTO VERDE x 100 3,421 0,82 0,82 TOTAL DE PUNTO VERDE *** 2,80 *** 146,32 72,98 04,00% 5,85 07,00% 5,11 447,04 227,74 10,96 230,26 GIRONA CONTRAVALOR CR NACIONAL II KM 7O8,2 EN PTA. P.P. 38312 Edited by Ingo - 20 Oct 11 at 10:31PM |
|
bart_bender
Beginner Joined: 04 Oct 11 Location: Spain Status: Offline Points: 17 |
Post Options
Thanks(0)
|
Hello Ingo,
Thanks for your answer. I'm using QuickPDFDLL0811.dll I got this result with the argument 0 EMISOR: GIRONA CR NACIONAL II KM 7O8,2 17181 AIGUAVIVA TEL.:972478000 PAG.: 1 YOIGO FECHA FACTURA: 02-01-2009 NOMBRE RAZON SOCIAL NUM. FACTURA : ( ) 0075123534 DIRECCION P. SUMINISTRO: 02-01-09 08006 BARCELONA FECHA DE PAGO: 05-04-09 BARCELONA FORMA DE PAGO: TRANSFERENCIA REF. DE PAGO : REF.: /001164/756661 NIF:A23453445 9364651 444,24 8 ESTERIL PL.1,5 160 1,870 299,20 0,967 144,48 PUNTO VERDE x 100 1,147 1,84 1,84 349 FRESA RACION PAK 6 4 5,180 |
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
There was a truncating bug in 8.11 that has been fixed in 8.12. The text is extracting correctly in 8.12 using GetPageText 0, 3 and 7. 8.12 is a free upgrade for owners of 8.11. The bug was caused by the recent major Unicode changes to the 8.11 version from 7.26.
Interestingly your PDF is 705mm wide by 998mm high which seems a big big for invoice. This currently affects the output of 8.12 with option 7. Andrew.
Edited by AndrewC - 24 Oct 11 at 8:04AM |
|
bart_bender
Beginner Joined: 04 Oct 11 Location: Spain Status: Offline Points: 17 |
Post Options
Thanks(0)
|
Thanks for your help Andrew
|
|
bart_bender
Beginner Joined: 04 Oct 11 Location: Spain Status: Offline Points: 17 |
Post Options
Thanks(0)
|
Hello Andrew
I'm testing the new version and i got the text truncated with the 8.12 equals 8.11 The Size that return dll.QuickPDFStringResultLength(instanceID) is half that real text In the 8.12 version is necesary to change two lines in the RC method for the Visual Basic Class Private Function SR(ByVal data As IntPtr) As String 1-->>> Dim size As Integer = dll.QuickPDFStringResultLength(instanceID) <<<-- Dim result As Byte() = New Byte(size - 1) {} Marshal.Copy(data, result, 0, size) 2-->>> Return Encoding.Default.GetString(result) <<<-- End Function 1 ->> Dim size As Integer = dll.QuickPDFStringResultLength(instanceID) * 2 2 ->> Return Encoding.Unicode.GetString(result) Best Regards Edited by bart_bender - 25 Oct 11 at 7:53AM |
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Thanks for the fixes. I will test it and then get these changes into the VB code. I was doing all my testing with C# and it is working correctly. The C# code for your reference is private string SR(IntPtr data) { int size = dll.QuickPDFStringResultLength(instanceID); byte[] result = new byte[size * 2]; Marshal.Copy(data, result, 0, size * 2); return Encoding.Unicode.GetString(result); } so in VB it probably should be Private Function SR(ByVal data as IntPtr) As String Dim size As Integer = dll.QuickPDFStringResultLength(instanceID) Dim result As Byte() = New Byte(size * 2 - 1) {} // as per post below Marshal.Copy(data, result, 0, size * 2) Return Encoding.Unicode.GetString(result) End Function Andrew.
Edited by AndrewC - 26 Oct 11 at 11:35AM |
|
bart_bender
Beginner Joined: 04 Oct 11 Location: Spain Status: Offline Points: 17 |
Post Options
Thanks(0)
|
Hello,
Change the code line Dim result As Byte() = New Byte(size * 2) {} to Dim result As Byte() = New Byte(size * 2 - 1) {} |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store