IPXV_PagesView - check if enough width space to SetZoom 100% ?  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
zarkogajic
User
Posts: 1473
Joined: Thu Sep 05, 2019 12:35 pm

IPXV_PagesView - check if enough width space to SetZoom 100% ?

Post by zarkogajic »

Hi Support,

Is there a way to check if there's "enough" width space inside PagesView so to: either IPXV_PagesView SetZoom() PXV_ZoomMode_Percent:100 OR PXV_ZoomMode_FitWidth - so that in both cases the entire width of the document's page is visible?

Or in other words, something better than this lame approach:

//pseudo
PagesView.SetZoom(PXV_ZoomMode_FitWidth, 0, false); //could end in zoom level <= 100 and OK
PagesView.Layout.Get_ZoomLevel(nZoom);
if nZoom > 100 then PagesView.SetZoom(PXV_ZoomMode_Percent, 100, false);

-žarko
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: IPXV_PagesView - check if enough width space to SetZoom 100% ?

Post by Vasyl - PDF-XChange »

Your pseudo-code slightly improved:

Code: Select all

auto L = PagesView.Layout;
L.LockUpdates();
L.SetZoom(PXV_ZoomMode_FitWidth, 0); 
if (L.ZoomLevel > 100) 
      L.SetZoom(PXV_ZoomMode_Percent, 100);
L.UnlockUpdates();
HTH
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1473
Joined: Thu Sep 05, 2019 12:35 pm

Re: IPXV_PagesView - check if enough width space to SetZoom 100% ?  SOLVED

Post by zarkogajic »

Hi Vasyl,

Thanks.

-žarko
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

IPXV_PagesView - check if enough width space to SetZoom 100% ?

Post by Stefan - PDF-XChange »

:)