GeneralButton Print for specific pages

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
martinli
Posts: 3
Joined: Wed Apr 10, 2013 8:48 am

Button Print for specific pages

Post by martinli »

Hello,

I'm using a several forms (Checklists) within one pdf document.
I would like to have a print button at the end of each checklist/form, but this print button shall only print the pages from that specific checklist.

Code: Select all

\renewcommand{\printfrom}{\thepage}
\begin{Form}
\TextField[width=4.2cm,name=remarkchecklist]{}
\CheckBox[name=okchecklist]}
\Acrobatmenu{Print}{Print}
\end{Form}
so generally I search for a way to have a printbutton as follows:

Code: Select all

\Acrobatmenu{Print}{Print}[\printfrom-\thispage]
Is there a way of doing this? Best without Javascript.

Thanks and best regards

Martin

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Button Print for specific pages

Post by cgnieder »

Hi Martin,

Welcome to the LaTeX community!

Can you extend your code snippet into a Infominimal working example (MWE), please? (Please follow the link if you're not sure what a MWE is.)

For reference to potential helpers: this question has also been asked on the German forum mrunix.

Regards
site moderator & package author
martinli
Posts: 3
Joined: Wed Apr 10, 2013 8:48 am

Button Print for specific pages

Post by martinli »

Hi,

The MWE is:

Code: Select all

\documentclass[12pt,oneside,a4paper,headinclude=on,footinclude=of f,DIV=20,BCOR=25mm]{scrartcl}
\usepackage[ngerman, english]{babel}
\usepackage{amsmath,amssymb,amsthm,amsfonts,latexs ym}
\usepackage[latin1]{inputenc}
\usepackage{courier}

\usepackage{lmodern}

\usepackage[T1]{fontenc}

%\usepackage[pdftex]{eforms}
\usepackage{mathptmx}
\renewcommand*{\familydefault}{phv}
\newcommand{\textforlabel}[2]{%
\TextField[name={#1},value={#2},width=7em,%
align=2,bordercolor={amdblau},readonly=true]{}%
}

\usepackage[
pdftex, a4paper=true, colorlinks=true,
pdftitle={Empty},
pdfsubject={Zugang},
pdfauthor={empty},
pdfpagemode=UseNone,pdfstartview=FitH,pdfhighlight={/N}
]{hyperref}


\begin{document}
Page 1: not to be printed \newpage
Page 2: Form 1 Page 1 \newcommand{\PrintFrom}{\thispage}\\

\begin{Form}[action=mailto:mail@mail.com?subject=Checklist: ,encoding=html,method=get]

\ChoiceMenu[combo,name=choice1,width=5cm]{choice}{choice1,choice2,choice3,choice4}\\
\newpage
Page 3: Form 1 Page 2\\
\ChoiceMenu[combo,name=choice2,width=5cm]{choice}{choice1,choice2,choice3,choice4}\\
\Submit{Submit}\\
\Reset{Reset}\\
\Acrobatmenu{Print}{Print}\\
\end{Form}
Page: 2-3 should be printed by clicking on Print

\newpage
Page 4: not to be printed
\newpage
Page 5: Form 2 Page 1 \renewcommand{\PrintFrom}{\thispage}\\

\begin{Form}[action=mailto:mail@mail.com?subject=Checklist: ,encoding=html,method=get]

\ChoiceMenu[combo,name=choice1,width=5cm]{choice}{choice1,choice2,choice3,choice4}\\
\newpage
Page 6: Form 2 Page 2\\
\ChoiceMenu[combo,name=choice2,width=5cm]{choice}{choice1,choice2,choice3,choice4}\\
\Submit{Submit}\\
\Reset{Reset}\\
\Acrobatmenu{Print}{Print}\\
\end{Form}
Page: 5-6 should be printed by clicking on Print

\newpage
Page 7: not to be printed
\end{document}
It does not contain the print "From-To" function.
What I wand is that Page 2-3 are printed py clicking on the Print button on Page 3; and if you click on the print button on page 6 the pages 5-6 should be printed.

Is this possible?

Many thanks and best regards

Martin
Attachments
Mini.pdf
MWE
(35.82 KiB) Downloaded 527 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: Button Print for specific pages

Post by cgnieder »

Unfortunately I cannot properly test this. My PDF viewer okular has troubles with forms anyway and my version of Acrobat Reader hangs as soon as I try to do anything with the form :( But then I don't have any experiences with forms anyway. Hopefully you'll get help by someone else.

Regards
site moderator & package author
martinli
Posts: 3
Joined: Wed Apr 10, 2013 8:48 am

Re: Button Print for specific pages

Post by martinli »

Well,
If this is not possible generally, then it would be great if someone could tell me so...
Many thanks
Martin
Post Reply