Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Wanting to refine a Print Button to scale to fit
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Wanting to refine a Print Button to scale to fit

 Post Reply Post Reply
Author
Alex8888 View Drop Down
New Member
New Member


Joined: 05 Jun 2018
Points: 2
Post Options Post Options   Quote Alex8888 Quote  Post ReplyReply Direct Link To This Post Topic: Wanting to refine a Print Button to scale to fit
    Posted: 05 Jun 2018 at 2:20pm
Hi folks, 

I've used this JavaScript 

this.print (false, this.pageNum,
this.pageNum);
to print the current page of the pdf. 

(I found the script in this article on Planet PDF which I found super-helpful: http://www.planetpdf.com/developer/article.asp?ContentID=printing_current_page_with_jav&gid=6054)

It works well, but it doesn't scale the page to fit on an 8.5 x 11 sheet of paper, so the margins are getting cropped off. I'm wondering if I can set it so that the page automatically scales to fit the paper, without having to open up the print dialog box and require the user to select that option manually. 

I've hunted around in this forum and on the web in general to see if anyone has asked this question before, but I haven't found what I'm looking for. 

I'd appreciate any ideas, directions or suggestions.

Many thanks,
---
Alex Hickey
Freelance Print Production Artist
Back to Top
Sponsored Links


Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4090
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jun 2018 at 3:23am
That is a pretty old post. Adobe has has added the PrintParams object that provides more control over printed output. You would use the pageHandling values.

 var pp = this.getPrintParams();

   pp.pageHandling = pp.constants.handling.fit;

   pp.firstPage = this.pageNum;

   pp.lastPage = this.pageNum;

   pp.interactive = pp.constants.interactionLevel.automatic;

   this.print(pp);

Back to Top
Alex8888 View Drop Down
New Member
New Member


Joined: 05 Jun 2018
Points: 2
Post Options Post Options   Quote Alex8888 Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jun 2018 at 9:14pm
This is awesome, gkaiseril. It works perfectly! Thank you, very, very, much! 
---
Alex Hickey
Freelance Print Production Artist
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.014 seconds.