Help for print button

12 views
Skip to first unread message

Alex

unread,
Jul 10, 2011, 7:21:16 AM7/10/11
to CenoPDF Support Group
Hi Yang,

I need your help for a Print button.

Can you show me the javascript to obtain the following results:

1) print the same page where button is;
2) print the following page (example: if the button is on page 23, I
need it prints page 24; if it's on 35, I must print 36)
3) print the two pages ahead (example: if the button is on page 23, I
need it prints page 25; if it's on 35, I must print 37)

Thank you and congratulations for your great application,
Alex

Yang Lu

unread,
Jul 10, 2011, 12:22:17 PM7/10/11
to cenos...@googlegroups.com
Hi Alex,

Here is the code you are looking for.

1.
var f = this.getField("mybutton");
this.print(false, f.page, f.page);

2.
var f = this.getField("mybutton");
this.print(false, f.page+1, f.page+1);

3.
var f = this.getField("mybutton");
this.print(false, f.page+2, f.page+2);

Basically the "page" property on a field object returns the 0 indexed page
number of where the field is on and you can pass this value to the "print"
method.

Thanks,
Yang

Hi Yang,

--
You received this message because you are subscribed to the Google Groups
"CenoPDF Support Group" group.
To post to this group, send email to cenos...@googlegroups.com.
To unsubscribe from this group, send email to
cenosupport...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/cenosupport?hl=en.


Alex

unread,
Jul 12, 2011, 3:41:35 PM7/12/11
to CenoPDF Support Group
Thank you very much,
Alex
> 1)printthe same page where button is;
> 2)printthe following page (example: if the button is on page 23, I need it
> prints page 24; if it's on 35, I mustprint36)
> 3)printthe two pages ahead (example: if the button is on page 23, I need

Alex

unread,
Jul 12, 2011, 6:16:28 PM7/12/11
to CenoPDF Support Group
Yang,

the script n. 2 doesn't works..

can you help me?

Thanks,
Alex

Yang Lu

unread,
Jul 12, 2011, 11:22:04 PM7/12/11
to cenos...@googlegroups.com
Alex,

My test showed it worked fine. Can you tell me why you think it did not
work? Note that if you have all those kind of buttons in the same document,
they must have different names; otherwise they won't work.

Alex

unread,
Jul 13, 2011, 8:26:32 AM7/13/11
to CenoPDF Support Group
Sorry... my mistake!

Thank you
Reply all
Reply to author
Forward
0 new messages