leandroavila74 Posted August 23, 2017 Share Posted August 23, 2017 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 More sharing options...
Sherzod Posted August 23, 2017 Share Posted August 23, 2017 Hi, If I understand correctly, can you try this approach ?!: For example: UniPDFFrame1.PdfURL := FUrl + '#page=1&zoom=50'; Best regards, Link to comment Share on other sites More sharing options...
leandroavila74 Posted August 23, 2017 Author Share Posted August 23, 2017 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 More sharing options...
Sherzod Posted August 23, 2017 Share Posted August 23, 2017 Could you tell me how do I call the print button without the user having to click on it? You can try to use this approach: MainForm.UniPDFFrame1.JSInterface.JSCall('iframe.contentWindow.print', []); Link to comment Share on other sites More sharing options...
leandroavila74 Posted August 23, 2017 Author Share Posted August 23, 2017 You can try to use this approach: MainForm.UniPDFFrame1.JSInterface.JSCall('iframe.contentWindow.print', []); Thanks a lot for the help Link to comment Share on other sites More sharing options...
Gianni Posted June 18, 2019 Share Posted June 18, 2019 Hi, I read all the comments. When I use: MainForm.UniPDFFrame1.JSInterface.JSCall('iframe.contentWindow.print', []); It's work wonderful, but the question is: Is there a way to print automatic? Link to comment Share on other sites More sharing options...
55143681 Posted January 18, 2022 Share Posted January 18, 2022 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 More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now