PDF Files with large bitmaps slow to display

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

Post Reply
johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

PDF Files with large bitmaps slow to display

Post by johnr@etakeoff.com » Fri Jun 24, 2011 5:18 pm

We're seeing PDF files containing large bitmaps display much more slowly with the PXCView SDK (0r the PDF XChange Viewer) than with Adobe. The problem is particularly bad with older CPUs.

The file below displays in about 1 second in Adobe but takes nearly 10 seconds with PXCView.

http://etakeoff.com/download/VerySlow062211.pdf

John - Tracker Supp
Site Admin
Posts: 8204
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: PDF Files with large bitmaps slow to display

Post by John - Tracker Supp » Sun Jun 26, 2011 3:28 am

Hi John,

can you please describe a typical systems resources there or perhaps use the option Help-> report a problem to send a sample systems tech info for us to investigate.

My somewhat basic laptop here takes about 7-8 sec's in our Viewer and Adobe 4-5 secs - so for sure there is a definite issue - but not of the magnitude you describe - there are also improvements coming which will help here in upcoming versions - also changing the memory allocated from Automatic to 50% yielded signifcant improvements (edit menu preferences -> performance)

and one signifcant benefit of the way PDF-XChange perfroms once the file is loaded - scrolling backwards to the top of the file is immeadiate - whereas Adobe will reload/refresh the page causing a delay - so there are pluses and minuses - its not all one way traffic ....
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: PDF Files with large bitmaps slow to display

Post by johnr@etakeoff.com » Mon Jun 27, 2011 2:12 pm

I'll work on getting more information about the systems where we see this.

We're using the SDK. How can I use that to do the equivalent of "changing the memory allocated from Automatic to 50%"?

You say "scrolling backwards is immediate". Does that mean you're cacheing all viewed pages? In our application that sould be a problem. Is there a way to disable that or clear the cache?

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13931
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF Files with large bitmaps slow to display

Post by Tracker Supp-Stefan » Tue Jun 28, 2011 1:03 pm

Hello John,

Please see the MemUsage object under
2.2.2.13 Performance in the Viewer AX SDK Manual for the possible values.

Yes we are caching the already rendered pages, but you can limit the maximum amount of memory our Viewer can use by the MemUsage in percentages.

After speaking with our developers further, there is even one more way to control the amount of memory that our Viewer could allocate -using the undocumented boolean UseMemExact object along with the simple integer property MemExact which contains the number of MB of RAM that our Viewer could allocate. If UseMemExact is false (which it is by default) the Viewer will use the value stored in MemUsage.

Best,
Stefan

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: PDF Files with large bitmaps slow to display

Post by johnr@etakeoff.com » Tue Jun 28, 2011 4:14 pm

We're using the simple SDK rather than the ActiveX. I don't see anything on MemUsage in the help.

We're already using PXCV_ReleasePageCachedData.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13931
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF Files with large bitmaps slow to display

Post by Tracker Supp-Stefan » Tue Jun 28, 2011 5:01 pm

Hello John,

I asked our project leader to check this and he says that we are slower in decoding JBIG2 images. He is now investigating why this is so and what we can do to improve the performance in this aspect.

Best,
Stefan
Tracker

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: PDF Files with large bitmaps slow to display

Post by johnr@etakeoff.com » Tue Jun 28, 2011 5:43 pm

I'm not sure that's the case we're seeing. I would expect you to decode them once when you load the page. We're seeing each screen refresh be slow as we pan and zoom.

Lzcat - Tracker Supp
Site Admin
Posts: 718
Joined: Thu Jun 28, 2007 8:42 am

Re: PDF Files with large bitmaps slow to display

Post by Lzcat - Tracker Supp » Wed Jun 29, 2011 6:30 am

pxcview.dll does not cache rendered page, but it cache internal PDF structure, decoded images, etc. PXCV_ReleasePageCachedData may releae them, so on each draw they will be decoded. Which parameters are you passing to PXCV_ReleasePageCachedData and how often do you call it?
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: PDF Files with large bitmaps slow to display

Post by johnr@etakeoff.com » Wed Jun 29, 2011 2:51 pm

When the user moves from one page to another, we call it on the previous page:

PXCV_ReleasePageCachedData(m_doc, nPgRelease, pxvrcd_ReleaseDocumentImages);

The slowness we're seeing happens even when zooming and scrolling on the same page.

Lzcat - Tracker Supp
Site Admin
Posts: 718
Joined: Thu Jun 28, 2007 8:42 am

Re: PDF Files with large bitmaps slow to display

Post by Lzcat - Tracker Supp » Wed Jun 29, 2011 2:58 pm

That is strange. Can you post code which is used for drawing?
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: PDF Files with large bitmaps slow to display

Post by johnr@etakeoff.com » Wed Jun 29, 2011 3:23 pm

void CRViewImgPdf::Draw(CDC* pDC, const RECT* pRectDst, const RECT* pRectCrop, UINT nFlags) const
{
PXV_CommonRenderParameters dp;
HRESULT hResult;
double dblMult;
RECT rectPg;
RECT rectDraw = *pRectDst;

dblMult = ((double)(pRectDst->right - pRectDst->left))
/ ((double)(pRectCrop->right - pRectCrop->left));
rectPg.left = (int)(0.5 + dblMult * (double)(-pRectCrop->left));
rectPg.top = (int)(0.5 + dblMult * (double)(-pRectCrop->top));
rectPg.right = rectPg.left + (int)(0.5 + dblMult * (double)m_nWidth);
rectPg.bottom = rectPg.top + (int)(0.5 + dblMult * (double)m_nHeight);
dp.WholePageRect = &rectPg;
dp.DrawRect = &rectDraw;
switch (m_nRotation)
{
case 0 : dp.Flags = pxvrpf_Rotate_NoRotate; break;
case 90 : dp.Flags = pxvrpf_Rotate_Rotate90CW;break;
case 180 : dp.Flags = pxvrpf_Rotate_Rotate180; break;
case 270 : dp.Flags = pxvrpf_Rotate_Rotate90CCW;break;
default: ASSERT(FALSE); break;
}
dp.Flags |= pxvrpf_NoTransparentBkgnd;
dp.RenderTarget = pxvrm_Viewing;
pDC->FillSolidRect(pRectDst, RGB(255,255,255));
hResult = PXCV_DrawPageToDC(m_doc, m_nPageCurr, pDC->m_hDC, &dp);
}

Here's the page change code:
BOOL CRViewImgPdf::PageCurrSet(int nPage)
{
BOOL bResult = TRUE;

if (nPage != m_nPageCurr)
{
int nPgRelease = m_nPageCurr;

m_nPageCurr = nPage;
if (nPgRelease >= 0)
{
PXCV_ReleasePageCachedData(m_doc, nPgRelease,
pxvrcd_ReleaseDocumentImages);
}
}
return (bResult);
}

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13931
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF Files with large bitmaps slow to display

Post by Tracker Supp-Stefan » Tue Jul 05, 2011 10:53 am

Hello John,

Victor did check and confirmed that there is an issue with the caching for drawings not working correctly.

I have created a ticket so this can be investigated:
#1121: SDK Viewer 2.5.196: PDF Files with large bitmaps slow to display
But whether it will be fixed depends on whether there will be a new build of our ver2 SDKs, as we are now working on ver3, and as ver3 is completely different this bug is not present there, so no fixing will be needed.

In any case we will keep you updated with any news on the subject as they become available.

Best,
Stefan

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: PDF Files with large bitmaps slow to display

Post by johnr@etakeoff.com » Tue Jul 05, 2011 3:22 pm

Any estimate on when version 3 might be released?

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13931
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF Files with large bitmaps slow to display

Post by Tracker Supp-Stefan » Tue Jul 05, 2011 3:48 pm

Hello John,

I am afraid that we can not be any more specific than this:
http://www.tracker-software.com/forum3/ ... hp?t=10100

Best,
Stefan

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: PDF Files with large bitmaps slow to display

Post by johnr@etakeoff.com » Fri Aug 12, 2011 10:05 pm

Any update on when the next version will be available?

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13931
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF Files with large bitmaps slow to display

Post by Tracker Supp-Stefan » Tue Aug 16, 2011 11:18 am

Sorry John,

But still nothing more specific than what is posted in the topic I linked earlier.

Best,
Stefan

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: PDF Files with large bitmaps slow to display

Post by johnr@etakeoff.com » Wed Nov 02, 2011 7:45 pm

Is this fixed in 2.5.199?

We're getting majopr complaints from our end users on this problem.
http://forum.etakeoff.com/topic/time-delay

User avatar
Paul - Tracker Supp
Site Admin
Posts: 4990
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: PDF Files with large bitmaps slow to display

Post by Paul - Tracker Supp » Wed Nov 02, 2011 9:00 pm

Hi John,

I checked the Support Request Ticket for this (RT#1121: SDK Viewer 2.5.196: PDF Files with large bitmaps slow to display) and it is reported as being fixed for the next build. That was before 198 so it should be good for 199. I've asked for confirmation of that. Have you tried it in 199?

regards
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

johnr@etakeoff.com
User
Posts: 57
Joined: Thu Jan 01, 1970 12:00 am

Re: PDF Files with large bitmaps slow to display

Post by johnr@etakeoff.com » Wed Nov 02, 2011 10:49 pm

Just downloaded and installed it. It fixed the problem. Thanks.

Is there any place to subscribe to get notices when a new release is posted?

Jamie - Tracker Supp
User
Posts: 207
Joined: Thu Jun 02, 2011 3:23 pm

Re: PDF Files with large bitmaps slow to display

Post by Jamie - Tracker Supp » Wed Nov 02, 2011 10:59 pm

Hi John,

Indeed there is! In the Communication Preferences section of your user account there is an option labeled, "New Product Availability Notifications". Simply place a check beside this.

Regards,
Jamie.

Post Reply