Imported Upstream version 1.23.0
[platform/upstream/groff.git] / src / devices / gropdf / gropdf.1.man
1 .TH gropdf @MAN1EXT@ "@MDATE@" "groff @VERSION@"
2 .SH Name
3 gropdf \-
4 .I groff
5 output driver for Portable Document Format
6 .
7 .
8 .\" ====================================================================
9 .\" Legal Terms
10 .\" ====================================================================
11 .\"
12 .\" Copyright (C) 2011-2022 Free Software Foundation, Inc.
13 .\"
14 .\" Permission is granted to make and distribute verbatim copies of this
15 .\" manual provided the copyright notice and this permission notice are
16 .\" preserved on all copies.
17 .\"
18 .\" Permission is granted to copy and distribute modified versions of
19 .\" this manual under the conditions for verbatim copying, provided that
20 .\" the entire resulting derived work is distributed under the terms of
21 .\" a permission notice identical to this one.
22 .\"
23 .\" Permission is granted to copy and distribute translations of this
24 .\" manual into another language, under the above conditions for
25 .\" modified versions, except that this permission notice may be
26 .\" included in translations approved by the Free Software Foundation
27 .\" instead of in the original English.
28 .
29 .
30 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
31 .do nr *groff_gropdf_1_man_C \n[.cp]
32 .cp 0
33 .
34 .\" Define fallback for groff 1.23's MR macro if the system lacks it.
35 .nr do-fallback 0
36 .if !\n(.f           .nr do-fallback 1 \" mandoc
37 .if  \n(.g .if !d MR .nr do-fallback 1 \" older groff
38 .if !\n(.g           .nr do-fallback 1 \" non-groff *roff
39 .if \n[do-fallback]  \{\
40 .  de MR
41 .    ie \\n(.$=1 \
42 .      I \%\\$1
43 .    el \
44 .      IR \%\\$1 (\\$2)\\$3
45 .  .
46 .\}
47 .rr do-fallback
48 .
49 .
50 .\" This macro definition is poor style from a portability standpoint,
51 .\" but it's a good test and demonstration of the standard font
52 .\" repertoire for the devices where it has any effect at all, and so
53 .\" should be retained.
54 .de FT
55 .  if '\\*(.T'ps' .ft \\$1
56 .  if '\\*(.T'pdf' .ft \\$1
57 ..
58 .
59 .\" ====================================================================
60 .SH Synopsis
61 .\" ====================================================================
62 .
63 .SY gropdf
64 .RB [ \-dels ]
65 .RB [ \-F\~\c
66 .IR font-directory ]
67 .RB [ \-I\~\c
68 .IR inclusion-directory ]
69 .RB [ \-p\~\c
70 .IR paper-format ]
71 \#.RB [ \-w\~\c
72 \#.IR n ]
73 .RB [ \-u
74 .RI [ cmap-file ]]
75 .RB [ \-y\~\c
76 .IR foundry ]
77 .RI [ file\~ .\|.\|.]
78 .YS
79 .
80 .
81 .SY gropdf
82 .B \-\-help
83 .YS
84 .
85 .
86 .SY gropdf
87 .B \-v
88 .
89 .SY gropdf
90 .B \-\-version
91 .YS
92 .
93 .
94 .\" ====================================================================
95 .SH Description
96 .\" ====================================================================
97 .
98 The GNU
99 .I roff
100 PDF output driver translates the output of
101 .MR @g@troff @MAN1EXT@
102 into Portable Document Format.
103 .
104 Normally,
105 .I gropdf
106 is invoked by
107 .MR groff @MAN1EXT@
108 when the latter is given the
109 .RB \[lq] \-T\~pdf \[rq]
110 option.
111 .
112 (In this installation,
113 .B @DEVICE@
114 is the default output device.)
115 .
116 Use
117 .IR groff 's
118 .B \-P
119 option to pass any options shown above to
120 .IR gropdf .
121 .
122 If no
123 .I file
124 arguments are given,
125 or if
126 .I file
127 is \[lq]\-\[rq],
128 .I gropdf
129 reads the standard input stream.
130 .
131 Output is written to the standard output stream.
132 .
133 .
134 .P
135 See section \[lq]Font installation\[rq] below for a guide to installing
136 fonts for
137 .IR gropdf .
138 .
139 .
140 .\" ====================================================================
141 .SH Options
142 .\" ====================================================================
143 .
144 .B \-\-help
145 displays a usage message,
146 while
147 .B \-v
148 and
149 .B \-\-version
150 show version information;
151 all exit afterward.
152 .
153 .
154 .TP
155 .B \-d
156 Include debug information as comments within the PDF.
157 .
158 Also produces an uncompressed PDF.
159 .
160 .
161 .TP
162 .B \-e
163 Forces
164 .I gropdf
165 to embed
166 .I all
167 fonts (even the 14 base PDF fonts).
168 .
169 .
170 .TP
171 .BI \-F " dir"
172 Prepend directory
173 .IR dir /dev name
174 to the search path for font, and device description files;
175 .I name
176 is the name of the device, usually
177 .BR pdf .
178 .
179 .TP
180 .BI \-I\~ dir
181 Search the directory
182 .I dir
183 for files named in
184 .B \[rs]X\[aq]pdf: pdfpic\[aq]
185 device control commands.
186 .
187 .B \-I
188 may be specified more than once;
189 each
190 .I dir
191 is searched in the given order.
192 .
193 To search the current working directory before others,
194 add
195 .RB \[lq] "\-I .\&" \[rq]
196 at the desired place;
197 it is otherwise searched last.
198 .
199 .
200 .TP
201 .B \-l
202 Orient the document in landscape format.
203 .
204 .TP
205 .BI \-p " paper-format"
206 Set the physical dimensions of the output medium.
207 .
208 This overrides the
209 .BR papersize ,
210 .BR paperlength ,
211 and
212 .B paperwidth
213 directives in the
214 .I DESC
215 file;
216 it accepts the same arguments as the
217 .B papersize
218 directive.
219 .
220 See
221 .MR groff_font @MAN5EXT@
222 for details.
223 .
224 .
225 .TP
226 .B \-s
227 Append a comment line to end of PDF showing statistics,
228 i.e.\& number of pages in document.
229 .
230 Ghostscript's
231 .B ps2pdf
232 complains about this line if it is included, but works anyway.
233 .
234 .
235 .TP
236 .BR \-u \~[\c
237 .IR cmap-file ]
238 .I gropdf
239 normally includes a ToUnicode CMap with any font created using
240 .I text.enc
241 as the encoding file,
242 this makes it easier to search for words which contain ligatures.
243 .
244 You can include your own CMap by specifying a
245 .I cmap-file
246 or have no CMap at all by omitting the argument.
247 .
248 .
249 .\" .TP
250 .\" .BI \-w n
251 .\" Lines should be drawn using a thickness of
252 .\" .IR n \~\c
253 .\" thousandths of an em.
254 .\" .
255 .\" If this option is not given, the line thickness defaults to
256 .\" 0.04\~em.
257 .\" .
258 .\" .
259 .TP
260 .BI \-y " foundry"
261 Set the foundry to use for selecting fonts of the same name.
262 .
263 .
264 .\" ====================================================================
265 .SH Usage
266 .\" ====================================================================
267 .
268 The input to
269 .I gropdf
270 must be in the format output by
271 .MR @g@troff @MAN1EXT@ .
272 .
273 This is described in
274 .MR groff_out @MAN5EXT@ .
275 .
276 In addition, the device and font description files for the device used
277 must meet certain requirements:
278 .
279 The resolution must be an integer multiple of\~72 times the
280 .BR sizescale .
281 .
282 The
283 .B pdf
284 device uses a resolution of 72000 and a sizescale of 1000.
285 .
286 .
287 .LP
288 The device description file must contain a valid paper format;
289 see
290 .MR groff_font @MAN5EXT@ .
291 .
292 .I gropdf
293 uses the same Type\~1 Adobe PostScript fonts as the
294 .B grops
295 device driver.
296 .
297 Although the PDF Standard allows the use of other font types (like
298 TrueType) this implementation only accepts the Type\~1 PostScript
299 font.
300 .
301 Fewer Type\~1 fonts are supported natively in PDF documents than the
302 standard 35 fonts supported by
303 .B grops
304 and all PostScript printers, but all the fonts are available since any
305 which aren't supported natively are automatically embedded in the
306 PDF.
307 .
308 .
309 .LP
310 .I gropdf
311 supports the concept of foundries,
312 that is different versions of basically the same font.
313 .
314 During install a
315 .I Foundry
316 file controls where fonts are found and builds
317 .I groff
318 fonts from the files it discovers on your system.
319 .
320 .
321 .LP
322 Each font description file must contain a command
323 .
324 .IP
325 .BI internalname\  psname
326 .
327 .LP
328 which says that the PostScript name of the font is
329 .IR psname .
330 .
331 Lines starting with
332 .B #
333 and blank lines are ignored.
334 .
335 The code for each character given in the font file must correspond
336 to the code in the default encoding for the font.
337 .
338 This code can be used with the
339 .B \[rs]N
340 escape sequence in
341 .B troff
342 to select the character,
343 even if the character does not have a
344 .I groff
345 name.
346 .
347 Every character in the font file must exist in the PostScript font, and
348 the widths given in the font file must match the widths used
349 in the PostScript font.
350 .
351 .
352 .LP
353 Note that
354 .I gropdf
355 is currently only able to display the first 256 glyphs in any font.
356 This restriction will be lifted in a later version.
357 .
358 .
359 .\" .LP
360 .\" Note that
361 .\" .B grops
362 .\" is able to display all glyphs in a PostScript font, not only 256.
363 .\" .I enc_file
364 .\" (or the default encoding if no encoding file specified) just defines
365 .\" the order of glyphs for the first 256 characters;
366 .\" all other glyphs are accessed with additional encoding vectors which
367 .\" .B grops
368 .\" produces on the fly.
369 .
370 .
371 .LP
372 .I gropdf
373 can automatically include the downloadable fonts necessary
374 to print the document.
375 .
376 Fonts may be in PFA or PFB format.
377 .LP
378 .
379 Any downloadable fonts which should, when required, be included by
380 .I gropdf
381 must be listed in the file
382 .IR @FONTDIR@/\:\%devpdf/\:\%download ;
383 this should consist of lines of the form
384 .
385 .IP
386 .I
387 foundry font filename
388 .
389 .LP
390 where
391 .I foundry
392 is the foundry name or blank for the default foundry.
393 .
394 .I font
395 is the PostScript name of the font,
396 and
397 .I filename
398 is the name of the file containing the font;
399 lines beginning with
400 .B #
401 and blank lines are ignored;
402 fields must be separated by tabs
403 (spaces are
404 .B not
405 allowed);
406 .I filename
407 is searched for using the same mechanism that is used
408 for
409 .I groff
410 font metric files.
411 .
412 The
413 .I download
414 file itself is also sought using this mechanism.
415 .
416 Foundry names are usually a single character
417 (such as \[oq]U\[cq] for the URW foundry)
418 or empty for the default foundry.
419 .
420 This default uses the same fonts as
421 .I ghostscript
422 uses when it embeds fonts in a PDF file.
423 .
424 .
425 .LP
426 In the default setup there are styles called
427 .BR R ,
428 .BR I ,
429 .BR B ,
430 and
431 .B BI
432 mounted at font positions 1 to\~4.
433 .
434 The fonts are grouped into families
435 .BR A ,
436 .BR BM ,
437 .BR C ,
438 .BR H ,
439 .BR HN ,
440 .BR N ,
441 .BR P ,
442 and\~\c
443 .B T
444 having members in each of these styles:
445 .
446 .RS
447 .TP
448 .B AR
449 .FT AR
450 AvantGarde-Book
451 .FT
452 .
453 .TQ
454 .B AI
455 .FT AI
456 AvantGarde-BookOblique
457 .FT
458 .
459 .TQ
460 .B AB
461 .FT AB
462 AvantGarde-Demi
463 .FT
464 .
465 .TQ
466 .B ABI
467 .FT ABI
468 AvantGarde-DemiOblique
469 .FT
470 .
471 .TQ
472 .B BMR
473 .FT BMR
474 Bookman-Light
475 .FT
476 .
477 .TQ
478 .B BMI
479 .FT BMI
480 Bookman-LightItalic
481 .FT
482 .
483 .TQ
484 .B BMB
485 .FT BMB
486 Bookman-Demi
487 .FT
488 .
489 .TQ
490 .B BMBI
491 .FT BMBI
492 Bookman-DemiItalic
493 .FT
494 .
495 .TQ
496 .B CR
497 .FT CR
498 Courier
499 .FT
500 .
501 .TQ
502 .B CI
503 .FT CI
504 Courier-Oblique
505 .FT
506 .
507 .TQ
508 .B CB
509 .FT CB
510 Courier-Bold
511 .FT
512 .
513 .TQ
514 .B CBI
515 .FT CBI
516 Courier-BoldOblique
517 .FT
518 .
519 .TQ
520 .B HR
521 .FT HR
522 Helvetica
523 .FT
524 .
525 .TQ
526 .B HI
527 .FT HI
528 Helvetica-Oblique
529 .FT
530 .
531 .TQ
532 .B HB
533 .FT HB
534 Helvetica-Bold
535 .FT
536 .
537 .TQ
538 .B HBI
539 .FT HBI
540 Helvetica-BoldOblique
541 .FT
542 .
543 .TQ
544 .B HNR
545 .FT HNR
546 Helvetica-Narrow
547 .FT
548 .
549 .TQ
550 .B HNI
551 .FT HNI
552 Helvetica-Narrow-Oblique
553 .FT
554 .
555 .TQ
556 .B HNB
557 .FT HNB
558 Helvetica-Narrow-Bold
559 .FT
560 .
561 .TQ
562 .B HNBI
563 .FT HNBI
564 Helvetica-Narrow-BoldOblique
565 .FT
566 .
567 .TQ
568 .B NR
569 .FT NR
570 NewCenturySchlbk-Roman
571 .FT
572 .
573 .TQ
574 .B NI
575 .FT NI
576 NewCenturySchlbk-Italic
577 .FT
578 .
579 .TQ
580 .B NB
581 .FT NB
582 NewCenturySchlbk-Bold
583 .FT
584 .
585 .TQ
586 .B NBI
587 .FT NBI
588 NewCenturySchlbk-BoldItalic
589 .FT
590 .
591 .TQ
592 .B PR
593 .FT PR
594 Palatino-Roman
595 .FT
596 .
597 .TQ
598 .B PI
599 .FT PI
600 Palatino-Italic
601 .FT
602 .
603 .TQ
604 .B PB
605 .FT PB
606 Palatino-Bold
607 .FT
608 .
609 .TQ
610 .B PBI
611 .FT PBI
612 Palatino-BoldItalic
613 .FT
614 .
615 .TQ
616 .B TR
617 .FT TR
618 Times-Roman
619 .FT
620 .
621 .TQ
622 .B TI
623 .FT TI
624 Times-Italic
625 .FT
626 .
627 .TQ
628 .B TB
629 .FT TB
630 Times-Bold
631 .FT
632 .
633 .TQ
634 .B TBI
635 .FT TBI
636 Times-BoldItalic
637 .FT
638 .RE
639 .
640 .
641 .LP
642 There is also the following font which is not a member of a family:
643 .
644 .RS
645 .TP
646 .B ZCMI
647 .FT ZCMI
648 ZapfChancery-MediumItalic
649 .FT
650 .RE
651 .
652 .
653 .LP
654 There are also some special fonts called
655 .B S
656 for the PS Symbol font.
657 .
658 The lower case greek characters are automatically slanted (to match
659 the SymbolSlanted font (SS) available to PostScript).
660 .
661 Zapf Dingbats is available as
662 .BR ZD ;
663 the \[lq]hand pointing left\[rq] glyph
664 .RB ( \[rs][lh] )
665 is available since it has been defined using the
666 .B \[rs]X\[aq]pdf: xrev\[aq]
667 device control command,
668 which reverses the direction of letters within words.
669 .
670 .
671 .LP
672 The default color for
673 .B \[rs]m
674 and
675 .B \[rs]M
676 is black.
677 .
678 .
679 .LP
680 .I gropdf
681 understands some of the device control commands supported by
682 .MR grops 1 .
683 .
684 .
685 .TP
686 .B \[rs]X\[aq]ps: invis\[aq]
687 Suppress output.
688 .
689 .
690 .TP
691 .B \[rs]X\[aq]ps: endinvis\[aq]
692 Stop suppressing output.
693 .
694 .
695 .TP
696 .BI "\[rs]X\[aq]ps: exec gsave currentpoint 2 copy translate\~" n\~\c
697 .B rotate neg exch neg exch translate\[aq]
698 where
699 .I n
700 is the angle of rotation.
701 .
702 This is to support the
703 .B align
704 command in
705 .MR @g@pic 1 .
706 .
707 .
708 .TP
709 .B \[rs]X\[aq]ps: exec grestore\[aq]
710 Used by
711 .MR @g@pic 1
712 to restore state after rotation.
713 .
714 .
715 .TP
716 .BI "\[rs]X\[aq]ps: exec " "n\~" "setlinejoin\[aq]"
717 where
718 .I n
719 can be one of the following values.
720 .
721 .
722 .IP
723 0 = Miter join
724 .br
725 1 = Round join
726 .br
727 2 = Bevel join
728 .
729 .
730 .TP
731 .BI "\[rs]X\[aq]ps: exec " "n " "setlinecap\[aq]"
732 where
733 .I n
734 can be one of the following values.
735 .
736 .
737 .IP
738 0 = Butt cap
739 .br
740 1 = Round cap, and
741 .br
742 2 = Projecting square cap
743 .
744 .
745 .LP
746 .TP
747 .BR "\[rs]X\[aq]ps:\~" .\|.\|.\& "\~pdfmark\[aq]"
748 All the
749 .I pdfmark
750 macros installed by using
751 .I \-m pdfmark
752 or
753 .I \-m mspdf
754 (see documentation in
755 .IR pdfmark.pdf ).
756 .
757 A subset of these macros are installed automatically when you use
758 .B \-Tpdf
759 so you should not need to use
760 .RB \[lq] "\-m pdfmark" \[rq]
761 to access most PDF functionality.
762 .
763 .
764 .LP
765 .I gropdf
766 also supports a subset of the commands introduced in
767 .IR present.tmac .
768 .
769 Specifically it supports:-
770 .
771 .
772 .IP
773 PAUSE
774 .br
775 BLOCKS
776 .br
777 BLOCKE
778 .
779 .
780 .LP
781 Which allows you to create presentation type PDFs.
782 .
783 Many of the other
784 commands are already available in other macro packages.
785 .
786 .
787 .LP
788 These commands are implemented with
789 .I groff
790 X commands:-
791 .
792 .
793 .LP
794 .TP
795 .B \[rs]X\[aq]ps: exec %%%%PAUSE\[aq]
796 The section before this is treated as a block and is introduced using
797 the current
798 .B BLOCK
799 transition setting
800 (see
801 .RB \[lq] "\[rs]X\[aq]pdf: transition\[aq]" \[rq]
802 below).
803 .
804 Equivalently,
805 .B \%.pdfpause
806 is available as a macro.
807 .TP
808 .B \[rs]X\[aq]ps: exec %%%%BEGINONCE\[aq]
809 Any text following this command (up to %%%%ENDONCE) is shown only once,
810 the next %%%%PAUSE will remove it.
811 If producing a non-presentation PDF, i.e.\&
812 ignoring the pauses, see
813 .I \%GROPDF_NOSLIDE
814 below, this text is ignored.
815 .LP
816 .TP
817 .B \[rs]X\[aq]ps: exec %%%%ENDONCE\[aq]
818 This terminates the block defined by %%%%BEGINONCE.
819 This pair of commands
820 is what implements the \&.BLOCKS Once/.BLOCKE commands in
821 .IR present.tmac .
822 .
823 .
824 .LP
825 The
826 .I mom
827 macro package already integrates these extensions,
828 so you can build slides with
829 .IR mom .
830 .
831 .
832 .LP
833 If you use
834 .I present.tmac
835 with
836 .I gropdf
837 there is no need to run the program
838 .MR presentps @MAN1EXT@
839 since the output will already be a presentation PDF.
840 .
841 .
842 .LP
843 All other
844 .B ps:
845 tags are silently ignored.
846 .
847 .
848 .LP
849 One
850 .B \[rs]X
851 device control command used by the DVI driver is also recognised.
852 .
853 .
854 .TP
855 .BI \[rs]X\[aq]papersize= paper-format \[aq]
856 where the
857 .I paper-format
858 parameter is the same as that to the
859 .B papersize
860 directive.
861 .
862 See
863 .MR groff_font @MAN5EXT@ .
864 .
865 This means that you can alter the page size at will within the PDF file
866 being created by
867 .IR gropdf .
868 .
869 If you do want to change the paper format,
870 it must be done before you start creating the page.
871 .
872 .
873 .LP
874 .I gropdf
875 supports several more device control features using the
876 .B pdf:
877 tag.
878 .
879 Some have counterpart
880 .I convenience macros
881 that take the same arguments and behave equivalently.
882 .
883 .
884 .TP
885 .BI "\[rs]X\[aq]pdf: pdfpic\~" file\~\c
886 .IR "alignment width height line-length" \[aq]
887 Place an image of the specified
888 .I width
889 containing the PDF drawing from file
890 .I file
891 of desired
892 .I width
893 and
894 .I height
895 (if
896 .I height
897 is missing or zero then it is scaled proportionally).
898 .
899 If
900 .I alignment
901 is
902 .B \-L
903 the drawing is left-aligned.
904 .
905 If it is
906 .B \-C
907 or
908 .B \-R
909 a
910 .I line-length
911 greater than the width of the drawing is required as well.
912 .
913 If
914 .I width
915 is specified as zero then the width is scaled in proportion to the
916 height.
917 .
918 .\" .IP
919 .\" See
920 .\" .BR groff_tmac (@MAN7EXT@)
921 .\" for a description of the
922 .\" .B PSPIC
923 .\" macro which provides a convenient high-level interface for inclusion
924 .\" of PostScript graphics.
925 .
926 .TP
927 .B \[rs]X\[aq]pdf: xrev\[aq]
928 Toggle the reversal of glyph direction.
929 .
930 This feature works \[lq]letter by letter\[rq],
931 that is,
932 each letter in a word is reversed left-to-right,
933 not the entire word.
934 .
935 One application is the reversal of glyphs in the Zapf Dingbats font.
936 .
937 To restore the normal glyph orientation,
938 repeat the command.
939 .
940 .
941 .TP
942 .BI "\[rs]X\[aq]pdf: markstart " "/ANN-definition" \[aq]
943 .TQ
944 .B \[rs]X\[aq]pdf: markend\[aq]
945 Macros that support PDF bookmarks use these calls internally to
946 start and stop (respectively) the placement of the bookmark's
947 .I hot spot;
948 the user will have called
949 .RB \[lq] .pdfhref\~L \[rq]
950 with the text of the hot spot.
951 .
952 Normally,
953 these are never used except from within the
954 .I pdfmark
955 macros.
956 .
957 .
958 .TP
959 .B \[rs]X\[aq]pdf: marksuspend\[aq]
960 .TQ
961 .B \[rs]X\[aq]pdf: markrestart\[aq]
962 If you use a page location trap to produce a header or footer,
963 or otherwise interrupt a document's text,
964 you need to use these commands if a PDF
965 .I hot spot
966 crosses a trap boundary;
967 otherwise any text output by the trap will be marked as part of the hot
968 spot.
969 .
970 To prevent this error,
971 place these device control commands or their corresponding
972 convenience macros
973 .B \%.pdfmarksuspend
974 and
975 .B \%.pdfmarkrestart
976 at the start and end of the trap macro,
977 respectively.
978 .
979 .
980 .TP
981 .BI "\[rs]X\[aq]pdf: pagename\~" name \[aq]
982 Assign the current page a
983 .IR name .
984 .
985 All documents bear two default names,
986 .RB \[oq] top "\[cq] and \[oq]" bottom \[cq].
987 .
988 The convenience macro for this command is
989 .BR \%.pdfpagename .
990 .
991 .
992 .TP
993 .BI "\[rs]X'pdf: switchtopage\~" "when name" \[aq]
994 Normally each new page is appended to the end of the document,
995 this command allows following pages to be inserted at a
996 .I \[oq]named\[cq]
997 position within the document (see pagename command above).
998 .I \[oq]when\[cq]
999 can be either
1000 .RI \[oq] after "\[cq] or \[oq]" before \[cq].
1001 If it is omitted it defaults to
1002 .RI \[oq] before \[cq].
1003 .
1004 It should be used at the end of the page before you want the switch to
1005 happen.
1006 .
1007 This allows pages such as a TOC to be moved to elsewhere in the
1008 document,
1009 but more esoteric uses are possible.
1010 .
1011 The convenience macro for this command is
1012 .BR \%.pdfswitchtopage .
1013 .
1014 .
1015 .TP
1016 .BI \[rs]X\[aq]pdf:\~transition\~ feature\~\c
1017 .IB "mode duration dimension motion direction scale bool" \[aq]
1018 where
1019 .I feature
1020 can be either SLIDE or BLOCK.
1021 When it is SLIDE the transition is used
1022 when a new slide is introduced to the screen,
1023 if BLOCK then this transition is used for the individual blocks which
1024 make up the slide.
1025 .
1026 .
1027 .IP
1028 .I mode
1029 is the transition type between slides:-
1030 .RS
1031 .IP
1032 .B Split
1033 - Two lines sweep across the screen, revealing the new page.
1034 The lines
1035 may be either horizontal or vertical and may move inward from the
1036 edges of the page or outward from the center, as specified by the
1037 .I dimension
1038 and
1039 .I motion
1040 entries, respectively.
1041 .br
1042 .B Blinds
1043 - Multiple lines, evenly spaced across the screen, synchronously
1044 sweep in the same direction to reveal the new page.
1045 The lines may be
1046 either horizontal or vertical, as specified by the
1047 .I dimension
1048 entry.
1049 Horizontal
1050 lines move downward; vertical lines move to the right.
1051 .br
1052 .B Box
1053 - A rectangular box sweeps inward from the edges of the page or
1054 outward from the center, as specified by the
1055 .I motion
1056 entry, revealing the new page.
1057 .br
1058 .B Wipe
1059 - A single line sweeps across the screen from one edge to the other in
1060 the direction specified by the
1061 .I direction
1062 entry, revealing the new page.
1063 .br
1064 .B Dissolve
1065 - The old page dissolves gradually to reveal the new one.
1066 .br
1067 .B Glitter
1068 - Similar to Dissolve,
1069 except that the effect sweeps across the page in a wide band moving from
1070 one side of the screen to the other in the direction specified by the
1071 .I direction
1072 entry.
1073 .br
1074 .B R
1075 - The new page simply replaces the old one with no special transition
1076 effect; the
1077 .I direction
1078 entry shall be ignored.
1079 .br
1080 .B Fly
1081 - (PDF 1.5) Changes are flown out or in (as specified by
1082 .IR motion ),
1083 in the
1084 direction specified by
1085 .IR direction ,
1086 to or from a location that is offscreen except
1087 when
1088 .I direction
1089 is
1090 .BR None .
1091 .br
1092 .B Push
1093 - (PDF 1.5) The old page slides off the screen while the new page
1094 slides in, pushing the old page out in the direction specified by
1095 .IR direction .
1096 .br
1097 .B Cover
1098 - (PDF 1.5) The new page slides on to the screen in the direction
1099 specified by
1100 .IR direction ,
1101 covering the old page.
1102 .br
1103 .B Uncover
1104 - (PDF 1.5) The old page slides off the screen in the direction
1105 specified by
1106 .IR direction ,
1107 uncovering the new page in the direction
1108 specified by
1109 .IR direction .
1110 .br
1111 .B Fade
1112 - (PDF 1.5) The new page gradually becomes visible through the
1113 old one.
1114 .LP
1115 .RE
1116 .IP
1117 .I duration
1118 is the length of the transition in seconds (default 1).
1119 .LP
1120 .IP
1121 .I dimension
1122 (Optional;
1123 .BR Split " and " Blinds
1124 transition styles only) The dimension in which the
1125 specified transition effect shall occur:
1126 .B H
1127 Horizontal, or
1128 .B V
1129 Vertical.
1130 .LP
1131 .IP
1132 .I motion
1133 (Optional;
1134 .BR Split ,
1135 .BR Box " and " Fly
1136 transition styles only) The direction of motion for
1137 the specified transition effect:
1138 .B I
1139 Inward from the edges of the page, or
1140 .B O
1141 Outward from the center of the page.
1142 .LP
1143 .IP
1144 .I direction
1145 (Optional;
1146 .BR Wipe ,
1147 .BR Glitter ,
1148 .BR Fly ,
1149 .BR Cover ,
1150 .BR Uncover " and " Push
1151 transition styles only)
1152 The direction in which the specified transition effect shall moves,
1153 expressed in degrees counterclockwise starting from a left-to-right
1154 direction.
1155 If the value is a number, it shall be one of:
1156 .B 0
1157 = Left to right,
1158 .B 90
1159 = Bottom to top (Wipe only),
1160 .B 180
1161 = Right to left (Wipe only),
1162 .B 270
1163 = Top to bottom,
1164 .B 315
1165 = Top-left to bottom-right (Glitter only)
1166 The value can be
1167 .BR None ,
1168 which is relevant only for the
1169 .B Fly
1170 transition when the value of
1171 .I scale
1172 is not 1.0.
1173 .LP
1174 .IP
1175 .I scale
1176 (Optional; PDF 1.5;
1177 .B Fly
1178 transition style only) The starting or ending scale at
1179 which the changes shall be drawn.
1180 If
1181 .I motion
1182 specifies an inward transition, the scale
1183 of the changes drawn shall progress from
1184 .I scale
1185 to 1.0 over the course of the
1186 transition.
1187 If
1188 .I motion
1189 specifies an outward transition, the scale of the changes drawn
1190 shall progress from 1.0 to
1191 .I scale
1192 over the course of the transition
1193 .LP
1194 .IP
1195 .I bool
1196 (Optional; PDF 1.5;
1197 .B Fly
1198 transition style only) If
1199 .BR true ,
1200 the area that shall be flown
1201 in is rectangular and opaque.
1202 .LP
1203 .IP
1204 This command can be used by calling the macro
1205 .B .pdftransition
1206 using the parameters described above.
1207 Any of the parameters may be
1208 replaced with a "." which signifies the parameter retains its
1209 previous value, also any trailing missing parameters are ignored.
1210 .LP
1211 .IP
1212 .B Note:
1213 not all PDF Readers support any or all these transitions.
1214 .LP
1215 .
1216 .
1217 .TP
1218 .BI "\eX\[aq]pdf: background\~" "cmd left top right bottom weight" \[aq]
1219 .TQ
1220 .B "\eX\[aq]pdf: background off\[aq]"
1221 .TQ
1222 .BI "\eX\[aq]pdf: background footnote\~" bottom \[aq]
1223 produces a background rectangle on the page,
1224 where
1225 .RS
1226 .TP
1227 .I cmd
1228 is the command,
1229 which can be any of
1230 .RB \[lq] page | fill | box \[rq]
1231 in combination.
1232 .
1233 Thus,
1234 .RB \[lq] pagefill \[rq]
1235 would draw a rectangle which covers the whole current page size
1236 (in which case the rest of the parameters can be omitted because the box
1237 dimensions are taken from the current media size).
1238 .
1239 .RB \[lq] boxfill \[rq],
1240 on the other hand,
1241 requires the given dimensions to place the box.
1242 .
1243 Including
1244 .RB \[lq] fill \[rq]
1245 in the command will paint the rectangle with the current fill colour
1246 (as with
1247 .BR \[rs]M[] )
1248 and including
1249 .RB \[lq] box \[rq]
1250 will give the rectangle a border in the current stroke colour
1251 (as with
1252 .BR \[rs]m[] ).
1253 .
1254 .
1255 .IP
1256 .I cmd
1257 may also be
1258 .RB \[lq] off \[rq]
1259 on its own,
1260 which will terminate drawing the current box.
1261 .
1262 If you have specified a page colour with
1263 .RB \[lq] pagefill \[rq],
1264 it is always the first box in the stack,
1265 and if you specify it again,
1266 it will replace the first entry.
1267 .
1268 Be aware that the
1269 .RB \[lq]  pagefill \[rq]
1270 box renders the page opaque,
1271 so tools that \[lq]watermark\[rq] PDF pages are unlikely to be
1272 successful.
1273 .
1274 To return the background to transparent,
1275 issue an
1276 .RB \[lq] off \[rq]
1277 command with no other boxes open.
1278 .
1279 .
1280 .IP
1281 Finally,
1282 .I cmd
1283 may be
1284 .RB \[lq] footnote \[rq]
1285 followed by a new value for
1286 .IR bottom ,
1287 which will be used for all open boxes on the current page.
1288 This is to allow room for footnote areas that grow while a page is
1289 processed
1290 (to accommodate multiple footnotes,
1291 for instance).
1292 .
1293 (If the value is negative,
1294 it is used as an offset from the bottom of the page.)
1295 .
1296 .
1297 .TP
1298 .I left
1299 .TQ
1300 .I top
1301 .TQ
1302 .I right
1303 .TQ
1304 .I bottom
1305 are the coordinates of the box.
1306 .
1307 The
1308 .I top
1309 and
1310 .I bottom
1311 coordinates are the minimum and maximum for the box,
1312 since the actual start of the box is
1313 .IR groff 's
1314 drawing position when you issue the command,
1315 and the bottom of the box is the point where you turn the box
1316 .RB \[lq] off \[rq].
1317 .
1318 The top and bottom coordinates are used only if the box drawing extends
1319 onto the next page;
1320 ordinarily,
1321 they would be set to the header and footer margins.
1322 .
1323 .
1324 .TP
1325 .I weight
1326 provides the line width for the border if
1327 .RB \[lq] box \[rq]
1328 is included in the command.
1329 .
1330 .
1331 .P
1332 The convenience macro for this escape sequence is
1333 .BR .pdfbackground .
1334 .
1335 An
1336 .I sboxes
1337 macro file is also available;
1338 see
1339 .MR groff_tmac @MAN5EXT@ .
1340 .RE
1341 .
1342 .
1343 .\" ====================================================================
1344 .SS Macros
1345 .\" ====================================================================
1346 .
1347 .IR gropdf 's
1348 support macros in
1349 .I pdf\.tmac
1350 define the convenience macros described above.
1351 .
1352 Some features have no direct device control command counterpart.
1353 .
1354 .
1355 .\" pdfhref
1356 .
1357 .
1358 .TP
1359 .BI ".pdfinfo /" "field content"\~\c
1360 \&.\|.\|.
1361 Define PDF metadata.
1362 .
1363 .I field
1364 may be be one of
1365 .BR Title ,
1366 .BR Author ,
1367 .BR Subject ,
1368 .BR Keywords ,
1369 or another datum supported by the PDF standard or your reader.
1370 .
1371 .I field
1372 must be prefixed with a slash.
1373 .
1374 .
1375 .\" ====================================================================
1376 .SS "Importing graphics"
1377 .\" ====================================================================
1378 .
1379 .I gropdf
1380 supports only the inclusion of other PDF files for inline images.
1381 .
1382 Such a PDF file may,
1383 however,
1384 contain any of the graphic formats supported by
1385 the PDF standard,
1386 such as JPEG/JFIF,
1387 PNG,
1388 and GIF.
1389 .
1390 Any application that outputs PDF can thus be used to prepare files for
1391 embedding in documents processed by
1392 .I groff
1393 and
1394 .IR gropdf .
1395 .
1396 .
1397 .P
1398 The PDF file you wish to insert must be a single page and the drawing
1399 must just fit inside the media size of the PDF file.
1400 .
1401 In
1402 .MR inkscape 1
1403 or
1404 .MR gimp 1 ,
1405 for example,
1406 make sure the canvas size just fits the image.
1407 .
1408 .
1409 .P
1410 The PDF parser
1411 .I gropdf
1412 implements has not been rigorously tested with all applications that
1413 produce PDF.
1414 .
1415 If you find a single-page PDF which fails to import properly,
1416 try processing it with the
1417 .MR pdftk 1
1418 program.
1419 .
1420 .
1421 .RS
1422 .EX
1423 pdftk\~\c
1424 .I existing-file\~\c
1425 output\~\c
1426 .I new-file
1427 .EE
1428 .RE
1429 .
1430 You may find that
1431 .I new-file
1432 imports successfully.
1433 .
1434 .
1435 .\" ====================================================================
1436 .SS "TrueType and other font formats"
1437 .\" ====================================================================
1438 .
1439 .I gropdf
1440 does not yet support any font formats besides Adobe Type 1
1441 (PFA or PFB).
1442 .
1443 .
1444 .\" ====================================================================
1445 .SH "Font installation"
1446 .\" ====================================================================
1447 .
1448 The following is a step-by-step font installation guide for
1449 .I gropdf.
1450 .
1451 .
1452 .IP \[bu] 2n
1453 Convert your font to something
1454 .I groff
1455 understands.
1456 .
1457 This is a PostScript Type\~1 font in PFA or PFB format,
1458 together with an AFM file.
1459 .
1460 A PFA file begins as follows.
1461 .
1462 .RS
1463 .RS \" two RS calls to get inboard of IP indentation
1464 .EX
1465 %!PS\-AdobeFont\-1.0:
1466 .EE
1467 .RE \" but only one to get back to it
1468 .
1469 A PFB file contains this string as well,
1470 preceded by some non-printing bytes.
1471 .
1472 In the following steps,
1473 we will consider the use of CTAN's
1474 .UR https://\:ctan.org/\:tex\-archive/\:fonts/\:brushscr
1475 BrushScriptX-Italic
1476 .UE
1477 font in PFA format.
1478 .RE \" now restore left margin
1479 .
1480 .
1481 .IP \[bu]
1482 Convert the AFM file to a
1483 .I groff
1484 font description file with the
1485 .MR afmtodit @MAN1EXT@
1486 program.
1487 .
1488 For instance,
1489 .
1490 .RS
1491 .RS \" two RS calls to get inboard of IP indentation
1492 .EX
1493 $ \c
1494 .B afmtodit BrushScriptX\-Italic.afm text.map BSI
1495 .EE
1496 .RE \" but only one to get back to it
1497 .
1498 converts the Adobe Font Metric file
1499 .I BrushScriptX\-Italic.afm
1500 to the
1501 .I groff
1502 font description file
1503 .IR BSI .
1504 .RE \" now restore left margin
1505 .
1506 .
1507 .IP
1508 If you have a font family which provides regular upright (roman),
1509 bold,
1510 italic,
1511 and
1512 bold-italic styles,
1513 (where \[lq]italic\[rq] may be \[lq]oblique\[rq] or \[lq]slanted\[rq]),
1514 we recommend using
1515 .BR R ,
1516 .BR B ,
1517 .BR I ,
1518 and
1519 .BR BI ,
1520 respectively,
1521 as suffixes to the
1522 .I groff
1523 font family name to enable
1524 .IR groff 's
1525 font family and style selection features.
1526 .
1527 An example is
1528 .IR groff 's
1529 built-in support for Times:
1530 the font family
1531 name is abbreviated as
1532 .BR T ,
1533 and the
1534 .I groff
1535 font names are therefore
1536 .BR TR ,
1537 .BR TB ,
1538 .BR TI ,
1539 and
1540 .BR TBI .
1541 .
1542 In our example,
1543 however,
1544 the BrushScriptX font is available in a single style only,
1545 italic.
1546 .
1547 .
1548 .IP \[bu]
1549 Install the
1550 .I groff
1551 font description file(s) in a
1552 .I devpdf
1553 subdirectory in the search path that
1554 .I groff
1555 uses for device and font file descriptions.
1556 .
1557 See the
1558 .I GROFF_FONT_PATH
1559 entry in section \[lq]Environment\[rq] of
1560 .MR @g@troff @MAN1EXT@
1561 for the current value of the font search path.
1562 .
1563 While
1564 .I groff
1565 doesn't directly use AFM files,
1566 it is a good idea to store them alongside its font description files.
1567 .
1568 .
1569 .IP \[bu]
1570 Register fonts in the
1571 .I devpdf/download
1572 file so they can be located for embedding in PDF files
1573 .I gropdf
1574 generates.
1575 .
1576 Only the first
1577 .I download
1578 file encountered in the font search path is read.
1579 .
1580 If in doubt,
1581 copy the default
1582 .I download
1583 file
1584 (see section \[lq]Files\[rq] below)
1585 to the first directory in the font search path and add your fonts there.
1586 .
1587 The PostScript font name used by
1588 .I gropdf
1589 is stored in the
1590 .B internalname
1591 field in the
1592 .I groff
1593 font description file.
1594 .
1595 (This name does not necessarily resemble the font's file name.)
1596 .
1597 If the font in our example had originated from a foundry named
1598 .BR Z ,
1599 we would add the following line to
1600 .IR download .
1601 .
1602 .RS
1603 .RS \" two RS calls to get inboard of IP indentation
1604 .EX
1605 Z\[->]BrushScriptX\-Italic\[->]BrushScriptX\-Italic.pfa
1606 .EE
1607 .RE \" but only one to get back to it
1608 .
1609 A tab character,
1610 depicted as \[->],
1611 separates the fields.
1612 .
1613 The default foundry has no name:
1614 its field is empty and
1615 entries corresponding to it start with a tab character,
1616 as will the one in our example.
1617 .RE \" now restore left margin
1618 .
1619 .
1620 .IP \[bu]
1621 Test the selection and embedding of the new font.
1622 .
1623 .RS
1624 .RS \" two RS calls to get inboard of IP indentation
1625 .EX
1626 printf "\[rs]\[rs]f[BSI]Hello, world!\[rs]n" \
1627 | groff \-T pdf \-P \-e >hello.pdf
1628 see hello.pdf
1629 .EE
1630 .RE
1631 .RE
1632 .
1633 .
1634 .br
1635 .ne 5v
1636 .\" ====================================================================
1637 .SH Environment
1638 .\" ====================================================================
1639 .
1640 .TP
1641 .I GROFF_FONT_PATH
1642 A list of directories in which to seek the selected output device's
1643 directory of device and font description files.
1644 .
1645 If,
1646 in the
1647 .I download
1648 file,
1649 the font file has been specified with a full path,
1650 no directories are searched.
1651 .
1652 See
1653 .MR @g@troff @MAN1EXT@
1654 and
1655 .MR groff_font @MAN5EXT@ .
1656 .
1657 .
1658 .TP
1659 .I GROPDF_NOSLIDE
1660 If set and evaluates to a true value
1661 (to Perl),
1662 .\" XXX: The above is inconsistent with the way grotty(1) handles
1663 .\" "GROFF_NO_SGR".
1664 .I gropdf
1665 ignores commands specific to presentation PDFs,
1666 producing a normal PDF instead.
1667 .
1668 .
1669 .TP
1670 .I SOURCE_DATE_EPOCH
1671 A timestamp
1672 (expressed as seconds since the Unix epoch)
1673 to use as the output creation timestamp in place of the current time.
1674 .
1675 The time is converted to human-readable form using Perl's
1676 .I \%localtime()
1677 function and recorded in a PDF comment.
1678 .
1679 .
1680 .TP
1681 .I TZ
1682 The time zone to use when converting the current time
1683 (or value of
1684 .IR SOURCE_DATE_EPOCH )
1685 to human-readable form;
1686 see
1687 .MR tzset 3 .
1688 .
1689 .
1690 .\" ====================================================================
1691 .SH Files
1692 .\" ====================================================================
1693 .
1694 .TP
1695 .I @FONTDIR@/\:\%devpdf/\:DESC
1696 describes the
1697 .B pdf
1698 output device.
1699 .
1700 .
1701 .TP
1702 .IR @FONTDIR@/\:\%devpdf/ F
1703 describes the font known
1704 .RI as\~ F
1705 on device
1706 .BR pdf .
1707 .
1708 .
1709 .TP
1710 .IR @FONTDIR@/\:\%devpdf/\:U\- F
1711 describes the font
1712 from the URW foundry
1713 (versus the Adobe default)
1714 known
1715 .RI as\~ F
1716 on device
1717 .BR pdf .
1718 .
1719 .
1720 .TP
1721 .I @FONTDIR@/\:\%devpdf/\%download
1722 lists fonts available for embedding within the PDF document
1723 (by analogy to the
1724 .B ps
1725 device's downloadable font support).
1726 .
1727 .
1728 .\" XXX: Why are we shipping this but not BuildFoundries.pl?
1729 .TP
1730 .I @FONTDIR@/\:\%devpdf/\%Foundry
1731 is a data file used by the
1732 .I groff
1733 build system to locate PostScript Type\~1 fonts.
1734 .
1735 .
1736 .TP
1737 .I @FONTDIR@/\:\%devpdf/\:enc/\:\%text\:.enc
1738 describes the encoding scheme used by most PostScript Type\~1 fonts;
1739 the
1740 .B \%encoding
1741 directive of
1742 font description files for the
1743 .B pdf
1744 device refers to it.
1745 .
1746 .
1747 .TP
1748 .I @MACRODIR@/\:pdf\:.tmac
1749 defines macros for use with the
1750 .B pdf
1751 output device.
1752 .
1753 It is automatically loaded by
1754 .I troffrc
1755 when the
1756 .B pdf
1757 output device is selected.
1758 .
1759 .
1760 .TP
1761 .I @MACRODIR@/\:\%pdfpic\:.tmac
1762 defines the
1763 .B PDFPIC
1764 macro for embedding images in a document;
1765 see
1766 .MR groff_tmac @MAN5EXT@ .
1767 .
1768 It is automatically loaded by
1769 .I troffrc.
1770 .\"
1771 .\"
1772 .\" .TP
1773 .\" .B @MACRODIR@/pspic.tmac
1774 .\" Definition of
1775 .\" .B PSPIC
1776 .\" macro,
1777 .\" automatically loaded by
1778 .\" .BR ps.tmac .
1779 .\" .
1780 .
1781 .
1782 .\" ====================================================================
1783 .SH Authors
1784 .\" ====================================================================
1785 .
1786 .I gropdf
1787 was written and is maintained by
1788 .MT deri@\:chuzzlewit\:.myzen\:.co\:.uk
1789 Deri James
1790 .ME .
1791 .
1792 .
1793 .\" ====================================================================
1794 .SH "See also"
1795 .\" ====================================================================
1796 .
1797 .TP
1798 .I @DOCDIR@/\:\%sboxes/\:\%msboxes\:.ms
1799 .TQ
1800 .I @DOCDIR@/\:\%sboxes/\:\%msboxes\:.pdf
1801 \[lq]Using PDF boxes with
1802 .I groff
1803 and the
1804 .I ms
1805 macros\[rq],
1806 by Deri James.
1807 .
1808 .
1809 .TP
1810 .I present.tmac
1811 is part of
1812 .UR https://\:bob\:.diertens\:.org/\:corner/\:useful/\:gpresent/
1813 .I gpresent
1814 .UE ,
1815 a software package by Bob Diertens that works with
1816 .I groff
1817 to produce presentations
1818 (\[lq]foils\[rq],
1819 or \[lq]slide decks\[rq]).
1820 .
1821 .
1822 .P
1823 .MR afmtodit @MAN1EXT@ ,
1824 .MR groff @MAN1EXT@ ,
1825 .MR @g@troff @MAN1EXT@ ,
1826 .MR groff_font @MAN5EXT@ ,
1827 .MR groff_out @MAN5EXT@
1828 .\" Not actually referenced in above discussion.
1829 .\" .BR \%pfbtops (@MAN1EXT@),
1830 .\" .BR \%groff_tmac (@MAN5EXT@),
1831 .
1832 .
1833 .\" Clean up.
1834 .rm FT
1835 .
1836 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
1837 .cp \n[*groff_gropdf_1_man_C]
1838 .do rr *groff_gropdf_1_man_C
1839 .
1840 .
1841 .\" Local Variables:
1842 .\" fill-column: 72
1843 .\" mode: nroff
1844 .\" End:
1845 .\" vim: set filetype=groff textwidth=72: