I made a slight modification to our app and the time taken to open a PDF and render the first page went from 6s to over 20s.
So basically this is opening a specific PDF containing 6 pages, with the Viewer set to a fixed height and varying the width, the PDF is set to display as FitFullPage which works out to be scaled at 81% and results in the displayed size of a page to be 393px by 696px in all the scenarios below.
In scenario 1 the Viewer is constrained to a width of 800px, thats still wider than the scaled image, there is a grey border area either side of the PDF image, it takes about 6s to open.
In scenario 2 the Viewer is constrained to a width of 1600px, nothing else changes, time to open is 11s
In scenario 3 the viewer is constrained to a width of 2400px, time to open is now 22s.
Note in all 3 cases the vertical height is unchanged and the displayed size of the PDF is the same 393px by 696px in all 3 cases, the only change is width of the 'grey areas' either side of the PDF where nothing is rendered. FWIW in all cases the PDF page is rendered as 'bands' of approx 393px by 170px. Also all the 'extra time' is spent with the progress bar at 100%, i.e. to the user the app is 'doing nothing'.
At the largest Viewer size there were subsequent rendering issues, in some cases leaving pages blank and requiring to scroll back up and then down again to get the viewer to 'regenerate' the image even though the image output size was still the same as in scenario 1.
I can understand the rendering speed being related to the output image size, I would expect it to be slower if I made it fit width and displayed at 2400px but it being directly related to the Viewer size is surprising.
The problem with this is we would generaly set the Viewer to be a width of 100% of its container, and then have it render fast at small sizes and slower if zoomed in, users get it being slower in that situation but it being very slow even with a small image size wont work.
The only work around I can see is to constrain the width of the viewer to say a max of about 800px though this will likely generate feedback from people with larger monitors that will feel they are unecessarily scrolling horizontally .
Anybody got thoughts on this?
Can you share an example PDF?