Rank: Newbie
Groups: Registered
Joined: 3/21/2021(UTC) Posts: 7  Location: Sydney Thanks: 2 times
|
Hi, Hope someone here can help me. Recently we upgraded Pdfium SDK from 4.6.2704 to 4.51.2704 and immediately noticed a performance difference between the versions. We have a pdf file with 728 PdfControls in total, spread across 20 pages. Once the file is loaded, we enumerate all controls on each page, and then for each control we access the Field property to obtain FieldType, FullName, etc as shown below: Code:
FormFieldTypes[] SupportedFieldTypes = { ... };
public void GetPdfPageInfo(PdfDocument doc)
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
var pageControls = doc.Pages.Select(p => doc.FormFill.InterForm.GetPageControls(p)).ToList();
var count = 0;
foreach (var pageControl in pageControls)
{
foreach (var control in pageControl)
{
var fieldFullName = control.Field.FullName;
if (SupportedFieldTypes.Contains(control.Field.FieldType))
{
var field = control.Field;
}
count++;
}
}
stopWatch.Stop();
var ts = stopWatch.Elapsed;
Debug.WriteLine($"{ts.Minutes:00}:{ts.Seconds:00}:{ts.Milliseconds:000}"); // about 7 secs
Debug.WriteLine($"{count}"); // Count:728
}
When used with 4.51.2704, the above code takes about 7 secs to complete. However, in 4.6.2704 it was almost instantaneous. Moreover, if we comment out line 14, the delay drops down to 4 secs, and without line 18 further down to 2 secs. So every reference to the Field property substantially increases the execution time. How can we work around this issue and get nearly instantaneous performance as it was before the upgrade? Thanks in advance, Alex.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/21/2021(UTC) Posts: 7  Location: Sydney Thanks: 2 times
|
Originally Posted by: Paul Rayman  Done. Thanks Paul!
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
|
 1 user thanked Paul Rayman for this useful post.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/21/2021(UTC) Posts: 7  Location: Sydney Thanks: 2 times
|
Thanks! The issue was resolved in Pdfium.Net.SDK 4.54.2704.
|
|
|
|
|
|
Forum Jump
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.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close