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!
![]() |
Bug fix - If you have 18.11 source code. |
Post Reply ![]() |
Author | |
swb1 ![]() Debenu Quick PDF Library Expert ![]() Joined: 05 Dec 05 Location: United States Status: Offline Points: 102 |
![]() ![]() ![]() ![]() ![]() Posted: 16 Apr 25 at 10:43PM |
unit DebenuPDFLibraryFontRasterizer has a bug that can cause an infinite loop when rendering some PDFs
I DO NOT KNOW IF THIS IS THE EXTACT RIGHT THING TO DO!!! However, it fixed a problem I was having with a very small number of documents, and I know it does nothing that would break the vast majority that were already working. I have solved it in my library by adding an else/break condition in the function GetW2DictCount: function GetW2DictCount: Integer; begin Result := 0; Obj := Font.FindValueByKeyName('W2', True); if (Obj is TPDFArray) and (TPDFArray(Obj).Count > 1) then begin WArray := TPDFArray(Obj); WX := 0; while WX < (WArray.Count - 1) do begin if WArray.Item[WX] is TPDFNumeric then begin if WArray.Item[WX + 1] is TPDFNumeric then begin WX := WX + 5; Inc(Result); end else if WArray.Item[WX + 1] is TPDFArray then begin Inc(Result, TPDFArray(WArray.Item[WX + 1]).Count); Inc(WX, 2); end // ------------------- // swb 4-16-2025 if WX is never inc'd it will loop infinitely. else begin break; end; // ------------------- end else if WArray.Item[WX + 1] is TPDFArray then begin Inc(Result, TPDFArray(WArray.Item[WX + 1]).Count div 3); Inc(WX, 2); end; end; end; end;
|
|
![]() |
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