Jump to content

uniPDFFrame set zoom in runtime


leandroavila74

Recommended Posts

Set zoom in runtime
How do I set zoom to 50% in runtime
I tried in many ways and I could not.
 
In viewer.html I even set the property as selected to 50%,
But when you finish uploading the pdf back to "auto zoom"
<span id="scaleSelectContainer" class="dropdownToolbarButton">
                     <select id="scaleSelect" title="Zoom" tabindex="23" data-l10n-id="zoom">
                      <option id="pageAutoOption" title="" value="auto" data-l10n-id="page_scale_auto">Automatic Zoom</option>
                      <option id="pageActualOption" title="" value="page-actual" data-l10n-id="page_scale_actual">Actual Size</option>
                      <option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Fit Page</option>
                      <option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Full Width</option>
                      <option id="customScaleOption" title="" value="custom"></option>
                      <option title="" value="0.5" selected="selected" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 50 }'>50%</option>
                      <option title="" value="0.75" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 75 }'>75%</option>
                      <option title="" value="1" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 100 }'>100%</option>
                      <option title="" value="1.25" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 125 }'>125%</option>
                      <option title="" value="1.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 150 }'>150%</option>
                      <option title="" value="2" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 200 }'>200%</option>
                      <option title="" value="3" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 300 }'>300%</option>
                      <option title="" value="4" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 400 }'>400%</option>
                    </select>

If anyone can help me, I appreciate it.

 

 

 

 

 

Link to comment
Share on other sites

Hi,

 

If I understand correctly, can you try this approach ?!:

 

For example:

UniPDFFrame1.PdfURL := FUrl + '#page=1&zoom=50';

Best regards,

 

worked perfectly!

 

Not wanting to take up your time ...

 

Could you tell me how do I call the print button without the user having to click on it?
Link to comment
Share on other sites

  • 1 year later...
  • 2 years later...
On 8/23/2017 at 10:37 PM, Sherzod said:

 

You can try to use this approach:

MainForm.UniPDFFrame1.JSInterface.JSCall('iframe.contentWindow.print', []);

UniSession.AddJS (UnimPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("print").click()');

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...