diff --git a/html_manual/cpdfmanual.html b/html_manual/cpdfmanual.html index 55e0bf1..243e2c9 100644 --- a/html_manual/cpdfmanual.html +++ b/html_manual/cpdfmanual.html @@ -523,9 +523,9 @@ class="cmtt-10">-scale-page, -scale-to-fit, -scale-contents, -shift, -mediabox,
-crop) for various page dimensions: +class="cmtt-10">-mediabox, -crop) for various +page dimensions:
@@ -1150,26 +1150,28 @@ class="cmtt-10">-decompress, object streams are not compressed. id="x1-390005.2">Compressing a Document -

To compress the streams in a PDF file, use:

To compress the streams in a PDF file, use: +

+cpdf compresses any streams which have no compression using the FlateDecode method, with the exception of Metadata streams, which are left uncompressed. -

+

5.3 Squeezing a Document

-

To

To squeeze a PDF file, reducing its size by an average of about twenty percent (though sometimes not at all), use: -

Adding -squeeze to the command line when using another operation will squeeze the file or files upon output. -

The

The -squeeze operation writes some information about the squeezing process to standard output. The squeezing process involves several processes which losslessly attempt to reduce the file size. It is slow, so should not be used without thought. @@ -1183,8 +1185,8 @@ $ ./cpdf -squeeze in.pdf -o out.pdf  
Squeezing page data  
Recompressing document

-

-

The

+

The -squeeze-log-to <filename> option writes the log to the given file instead of to standard output. @@ -1204,15 +1206,15 @@ bookmarks. id="x1-420006.1">List Bookmarks -

The -list-bookmarks operation prints (to standard output) the bookmarks in a file. The -first column gives the level of the tree at which a particular bookmark is. Then the -text of the bookmark in quotes, then the page number which the bookmark points to, -then (optionally) the word ”open” if the bookmark should have its children (at the -level immediately below) visible when the file is loaded. For example, upon executing -

The -list-bookmarks operation prints (to standard output) the bookmarks in a file. The first column +gives the level of the tree at which a particular bookmark is. Then the text of the bookmark in quotes, +then the page number which the bookmark points to, then (optionally) the word ”open” if the +bookmark should have its children (at the level immediately below) visible when the file is loaded. For +example, upon executing +

-

the result might be: +

the result might be:

@@ -1222,29 +1224,29 @@ src="cpdfmanual66x.png" alt="" class="fbox" >  
0 "Part 2" 4  
1 "Part 2a" 5
-

-

If the page number is 0, it indicates that clicking on that entry doesn’t move to a page. -

By default,

+

If the page number is 0, it indicates that clicking on that entry doesn’t move to a page. +

By default, cpdf converts unicode to ASCII text, dropping characters outside the ASCII range. To prevent this, and return unicode UTF8 output, add the -utf8 option to the command. To prevent any processing, use the -raw option. -

+

6.2 Remove Bookmarks

-

The

The -remove-bookmarks operations removes all bookmarks from the file. -

-

+

6.3 Add Bookmarks

-

The

The -add-bookmarks file adds bookmarks as specified by a bookmarks file, a text file in ASCII or UTF8 encoding and in the same format as that produced by the Chapter 7
Presentations -

-

The PDF file format, starting at Version 1.1, provides for simple slide-show presentations in the +

The PDF file format, starting at Version 1.1, provides for simple slide-show presentations in the manner of Microsoft Powerpoint. These can be played in Acrobat and possibly other PDF viewers, typically started by entering full-screen mode. The -presentation operation allows such a presentation to be built from any PDF file. -

The

The -trans option chooses the transition style. When a page range is used, it is the transition from each page named which is altered. The following transition styles are available: @@ -1312,17 +1314,17 @@ class="description">The same as Dissolve but the effect sweeps across the page in the direction specified by the -direction option. -

To remove a transition style currently applied to the selected pages, omit the

To remove a transition style currently applied to the selected pages, omit the -trans option. -

The

The -effect-duration option specifies the length of time in seconds for the transition itself. The default value is one second. -

The

The -duration option specifies the maximum time in seconds that the page is displayed before the presentation automatically advances. The default, in the absence of the -duration option, is for no automatic advancement. -

The

The -direction option (for Wipe and Glitter styles only) specifies the direction of the effect. @@ -1342,10 +1344,10 @@ class="cmbx-10">Wipe only)

  • Top-left to bottom-right (Glitter only)
  • -

    For example: -

    For example: +

    -

    To use different options on different page ranges, run

    To use different options on different page ranges, run cpdf multiple times on the file using a different page range each time. @@ -1354,48 +1356,48 @@ page range each time. id="x1-460008">Watermarks and Stamps -

    8.1 Add a Watermark or Logo

    -

    The

    The -stamp-on and -stamp-under operations stamp the first page of a source PDF onto or under each page in the given range of the input file. For example, -

    stamps the file logo.pdf onto the odd pages of in.pdf, writing to out.pdf. A watermark should go underneath each page: -

    -

    The position commands in Section

    The position commands in Section 8.2.4 can be used to locate the stamp more precisely (they are calculated relative to the crop box of the stamp). Or, preprocess the stamp with -shift first. -

    The

    The -scale-stamp-to-fit option can be added to scale the stamp to fit the page before applying it. The use of positioning commands together with -scale-stamp-to-fit is not recommended. -

    The

    The -combine-pages operation takes two PDF files and stamps each page of one over each page of the other. The length of the output is the same as the length of the “under” file. For - - instance: -

    -

    Page attributes (such as the display rotation) are taken from the “under” file. For best results, remove +

    Page attributes (such as the display rotation) are taken from the “under” file. For best results, remove any rotation differences in the two files using -upright first. -

    The

    The -relative-to-cropbox option takes the positioning command to be relative to the crop box of each page rather than the media box. -

    +

    8.2 Stamp Text, Dates and Times.

    -

    The

    The -add-text operation allows text, dates and times to be stamped over one or more pages of the input at a given position and using a given font, font size and color. -

    -

    The default is black 12pt Times New Roman text in the top left of each page. The text can be placed +

    The default is black 12pt Times New Roman text in the top left of each page. The text can be placed underneath rather than over the page by adding the -underneath option. -

    Text previously added by

    Text previously added by cpdf may be removed by the -remove-text operation. -

    -

    +

    8.2.1 Page Numbers

    -

    There are various special codes to include the page number in the text: +

    There are various special codes to include the page number in the text:

    %Page      Page number in arabic notation (1, 2, 3...)
@@ -1434,19 +1436,19 @@ src=
    -

    For example, the format

    For example, the format "Page %Page of %EndPage" might become ”Page 5 of 17”. -

    NB: In some circumstances (e.g in batch files) on Microsoft Windows,

    NB: In some circumstances (e.g in batch files) on Microsoft Windows, % is a special character, and must be escaped (written as %%). Consult your local documentation for details. -

    +

    8.2.2 Date and Time Formats

    @@ -1470,18 +1472,18 @@ src="cpdfmanual78x.png" alt="%a Abbreviated weekday name (Sun, Mon etc.) %Y Year (0000–9999) %% The % character. " >
    -

    +

    8.2.3 Bates Numbers

    -

    Unique page identifiers can be specified by putting %Bates in the format. -The starting point can be set with the

    Unique page identifiers can be specified by putting %Bates in the format. The starting point can be set +with the -bates option. For example: -

    -

    To specify that bates numbering begins at the first page of the range, use

    To specify that bates numbering begins at the first page of the range, use -bates-at-range instead. This option must be specified after the range is specified. To pad the bates number up to a given number of leading zeros, use -bates-pad-to in addition to either -bates or -bates-at-range. -

    +

    8.2.4 Position

    -

    The position of the text may be specified either in absolute terms: +

    The position of the text may be specified either in absolute terms: -

    -

    Positions relative to certain common points can be set: -

    Positions relative to certain common points can be set: +

    -

    No attempt is made to take account of the page rotation when interpreting the position, so +

    No attempt is made to take account of the page rotation when interpreting the position, so -prerotate must be added to the command line if the file contains pages with a non-zero viewing rotation. This is equivalent to pre-processing the document with -upright. -

    The

    The -relative-to-cropbox modifier can be added to the command line to make these measurements relative to the crop box instead of the media box. -

    The default position is equivalent to

    The default position is equivalent to -topleft 100. -

    The

    The -midline option may be added to specify that the positioning commands above are to be considered relative to the midline of the text, rather than its baseline. Similarly, the -topline option may be used to specify that the position is taken relative to the top of the text. -

    +

    8.2.5 Font and Size

    -

    The font may be set with the

    The font may be set with the -font option. The 14 Standard PDF fonts are available:

    -

    For example, page numbers in Times Italic can be achieved by: -

    For example, page numbers in Times Italic can be achieved by: +

    See Section 14.1 for how to use other fonts. -

    The font size can be altered with the

    The font size can be altered with the -font-size option, which specifies the size in points: -

    -

    +

    8.2.6 Colors

    -

    The

    The -color option takes an RGB color, where red, green and blue components range between 0 and 1. The following values are predefined:

    @@ -1566,82 +1568,82 @@ src="cpdfmanual85x.png" alt="-Color--R,-G,-B--- green 0, 1, 0 blue 0, 0, 1 " >
    -

    -

    Partly-transparent text may be specified using the

    Partly-transparent text may be specified using the -opacity option. Wholly opaque is 1 and wholly transparent is 0. For example: -

    -

    +

    8.2.7 Outline Text

    -

    The

    The -outline option sets outline text. The line width (default 1pt) may be set with the -linewidth option. For example, to stamp documents as drafts: -

    -

    +

    8.2.8 Multi-line Text

    -

    The code

    The code \n can be included in the text string to move to the next line. In this case, the vertical position refers to the baseline of the first line of text (if the position is at the top, top left or top right of the page) or the baseline of the last line of text (if the position is at the bottom, bottom left or bottom right). -

    -

    The

    The -midline option may be used to make these vertical positions relative to the midline of a line of text rather than the baseline, as usual. -

    The

    The -line-spacing option can be used to increase or decrease the line spacing, where a spacing of 1 is the standard. -

    -

    Justification of multiple lines is handled by the

    Justification of multiple lines is handled by the -justify-left, -justify-right and
    -justify-center options. The defaults are left justification for positions relative to the left hand side of the page, right justification for those relative to the right, and center justification for positions relative to the center of the page. For example: -

    -

    +

    8.2.9 Special Characters

    -

    If your command line allows for the inclusion of unicode characters, the input text will be considered +

    If your command line allows for the inclusion of unicode characters, the input text will be considered as UTF8 by cpdf. Special characters which exist in the PDF WinAnsiEncoding Latin 1 code (such as many accented characters) will be reproduced in the PDF. This does not mean, however, that every special character can be reproduced. You must experiment. -

    For compatibility with previous versions of cpdf, special characters may be introduced manually +

    For compatibility with previous versions of cpdf, special characters may be introduced manually with a backslash followed by the three-digit octal code of the character in the PDF WinAnsiEncoding Latin 1 Code. The full table is included in Appendix D of the Adobe PDF Reference Manual, which is available at http://www.adobe.com/devnet/pdf/pdf_reference.html. -

    For example, a German sharp s (ß) may be introduced by

    For example, a German sharp s (ß) may be introduced by \337. -

    +

    8.3 Stamping Graphics

    -

    A rectangle may be placed on one or more pages by using the

    A rectangle may be placed on one or more pages by using the -add-rectangle <size> command. Most of the options discussed above for text placement apply in the same way. For example: -

    -

    This can be used to blank out or highlight part of the document. The following positioning options +

    This can be used to blank out or highlight part of the document. The following positioning options work as you would expect: -topleft, -top, -reverse-diagonal have no meaning. -

    +

    Chapter 9
    id="x1-600009.1">Two-up

    -

    This facility puts multiple logical pages on a single physical page. The

    This facility puts multiple logical pages on a single physical page. The -twoup-stack operation puts two logical pages on each physical page, rotating them 90 degrees to do so. The new mediabox is thus larger. The -twoup operation does the same, but scales the new sides down so that the media box is unchanged. -

    +

    9.2 Inserting Blank Pages

    -

    Sometimes, for instance to get a printing arrangement right, it’s useful to be able to insert blank pages +

    Sometimes, for instance to get a printing arrangement right, it’s useful to be able to insert blank pages into a PDF file. cpdf can add blank pages before a given page or pages, or after. The pages in question are specified by a range in the usual way: -

    The dimensions of the padded page are derived from the boxes (media box, crop box etc.) of the page after or before which the padding is to be applied. -

    The

    The -pad-every n operation places a blank page after every n pages, excluding any last one. For example… -

    …on a 9 page document adds a blank page after pages 3 and 6. -

    The

    The -pad-multiple n operation adds blank pages so the document has a multiple of n pages. For example: -

    -

    +

    Chapter 10
    id="x1-6300010.1">List Annotations

    -

    The

    The -list-annotations operation prints the textual content of any annotations on the selected pages to standard output. Each annotation is preceded by the page number and followed by a newline. -

    -

    +

    10.2 Copy Annotations

    -

    The

    The -copy-annotations operation copies the annotations in the given page range from one file (the file specified immediately after the option) to another pre-existing PDF. The range is specified after this pre-existing PDF. The result is then written an output file, specified in the usual way. -

    +

    10.3 Remove Annotations

    -

    The

    The -remove-annotations operation removes all annotations from the given page range. -

    -

    +

    Chapter 11
    Document Information and Metadata

    -

    11.1 Listing Fonts

    -

    The

    The -list-fonts operation prints the fonts in the document, one-per-line to standard output. For example: -

    -

    The first column gives the page number, the second the internal unique font name, the third the type +

    The first column gives the page number, the second the internal unique font name, the third the type of font (Type1, TrueType etc), the fourth the PDF font name, the fifth the PDF font encoding. -

    +

    11.2 Reading Document Information

    -

    The

    The -info option prints entries from the document information dictionary, and from any XMP metadata to standard output. -

    -

    The details of the format for creation and modification dates can be found in Appendix 

    The details of the format for creation and modification dates can be found in Appendix A. -

    By default, cpdf strips to ASCII, discarding character codes in excess of 127. In order to preserve +

    By default, cpdf strips to ASCII, discarding character codes in excess of 127. In order to preserve the original unicode, add the -utf8 option. To disable all postprocessing of the string, add -raw. -

    The

    The -page-info option prints the page label, media box and other boxes page-by-page to standard output, for all pages in the current range. -

    -

    Note that the format for boxes is minimum x, minimum y, maximum x, maximum y. -

    The

    Note that the format for boxes is minimum x, minimum y, maximum x, maximum y. +

    The -pages operation prints the number of pages in the file. -

    -

    +

    11.3 Setting Document Information

    -

    The

    The document information dictionary in a PDF file specifies various pieces of information about a PDF. These can be consulted in a PDF viewer (for instance, Acrobat). -

    Here is a summary of the commands for setting entries in the document information +

    Here is a summary of the commands for setting entries in the document information dictionary: -

    -

    (The details of the format for creation and modification dates can be found in Appendix 

    (The details of the format for creation and modification dates can be found in Appendix A. Using the date "now" uses the time and date at which the command is executed. Note also that -producer and -creator may be used to set the producer and/or the creator when writing any file, separate from the operations described in this chapter.) -

    For example, to set the title, the full command line would be -

    For example, to set the title, the full command line would be +

    -

    The text string is considered to be in UTF8 format, unless the

    The text string is considered to be in UTF8 format, unless the -raw option is added—in which case, it is unprocessed, save for the replacement of any octal escape sequence such as \017, which is replaced by a character of its value (here, 15). -

    +

    11.4 Upon Opening a Document

    -

    +

    11.4.1 Page Layout

    -

    The

    The -set-page-layout option specifies the page layout to be used when a document is opened in, for instance, Acrobat. The possible (case-sensitive) values are:

    @@ -1851,15 +1853,15 @@ TwoPageRight (PDF 1.5 and above) Display the pages two at a time, even numbered pages on the left " >

    -

    For instance: -

    For instance: +

    -

    +

    11.4.2 Page Mode

    -

    The

    The page mode in a PDF file defines how a viewer should display the document when first opened. The possible (case-sensitive) values are:

    @@ -1875,10 +1877,10 @@ UseOC (PDF 1.5 and above) Optional content group panel visi- UseAttachments (PDF 1.5 and above) Attachments panel visible " >

    -

    For instance: -

    For instance: +

    -

    +

    11.4.3 Display Options

    @@ -1893,41 +1895,41 @@ src="cpdfmanual112x.png" alt="-hide-toolbar Hide the viewer’s toolbar -display-doc- title title bar " >

    -

    For instance: -

    For instance: +

    -

    The page a PDF file opens at can be set using

    The page a PDF file opens at can be set using -open-at-page: -

    -

    To have that page scaled to fit the window in the viewer, use

    To have that page scaled to fit the window in the viewer, use -open-at-page-fit instead: -

    -

    +

    11.5 Metadata

    -

    PDF files can contain a piece of arbitrary metadata, often in XMP format. This is typically stored in +

    PDF files can contain a piece of arbitrary metadata, often in XMP format. This is typically stored in an uncompressed stream, so that other applications can read it without having to decode the whole PDF. To set the metadata: -

    -

    To remove any metadata: -

    To remove any metadata: +

    To print the current metadata to standard output: -

    -

    +

    11.6 Page Labels

    -

    It is possible to add

    It is possible to add page labels to a document. These are not the printed on the page, but may be displayed alongside thumbnails or in print dialogue boxes by PDF readers. We use -add-page-labels @@ -1944,35 +1946,35 @@ src="cpdfmanual119x.png" alt=" DecimalArabic 1,2,3,4,5... LowercaseLetters a,b,c,...,z,aa,bb... UppercaseLetters A,B,C,...,Z,AA,BB... NoLabelPrefixOnly No number, but a prefix will be used if defined. " > -

    We can use

    We can use -label-prefix to add a textual prefix to each label. Consider a file with twenty pages and no current page labels (a PDF reader will assume 1,2,3…if there are none). We will add the following page labels: -

    i, ii, iii, iv, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, A-0, A-1, A-2, A-3, A-4, A-5 -

    Here are the commands, in order: -

    i, ii, iii, iv, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, A-0, A-1, A-2, A-3, A-4, A-5 +

    Here are the commands, in order: +

    -

    By default the labels begin at page number 1 for each range. To override this, we can use +

    By default the labels begin at page number 1 for each range. To override this, we can use -label-startval (we used 0 in the final command), where we want the numbers to begin at zero rather than one. -

    Page labels may be removed altogether by using

    Page labels may be removed altogether by using -remove-page-labels command. To print the page labels from an existing file, use -print-page-labels. For example: -

    -

    +

    Chapter 12
    File Attachments

    -

    -

    PDF supports adding attachments (files of any kind, including other PDFs) to an existing file. The +

    PDF supports adding attachments (files of any kind, including other PDFs) to an existing file. The cpdf tool supports adding and removing document-level attachments — that is, ones which are @@ -1984,83 +1986,83 @@ class="cmti-10">attachments, associated with a particular page. id="x1-7700012.1">Adding Attachments -

    To add an attachment, use the

    To add an attachment, use the -attach-file option. For instance, -

    attaches the Excel spreadsheet sheet.xls to the input file. If the file already has attachments, the new file is added to their number. You can specify multiple files to be attached by using -attach-file multiple times. They will be attached in the given order. -

    The

    The -to-page option can be used to specify that the files will be attached to the given page, rather than at the document level. The -to-page option may be specified at most once. -

    +

    12.2 Listing Attachments

    -

    To list all document- and page-level attachments, use the

    To list all document- and page-level attachments, use the -list-attached-files operation. The page number and filename of each attachment is given, page 0 representing a document-level attachment. -

    -

    +

    12.3 Removing Attachments

    -

    To remove all document-level and page-level attachments from a file, use the

    To remove all document-level and page-level attachments from a file, use the -remove-files operation: -

    -

    +

    Chapter 13
    Working with Images

    -

    13.1 Detecting Low-resolution Images

    -

    To list all images in the given range of pages which fall below a given resolution (in dots-per-inch), use +

    To list all images in the given range of pages which fall below a given resolution (in dots-per-inch), use the -image-resolution function: -

    +

    -

    The format is

    The format is page number, image name, x pixels, y pixels, x resolution, y resolution. The resolutions refer to the image’s effective resolution at point of use (taking account of scaling, rotation etc). -

    +

    Chapter 14
    Fonts

    -

    14.1 Copying Fonts

    -

    In order to use a font other than the standard 14 with

    In order to use a font other than the standard 14 with -add-text, it must be added to the file. The font source PDF is given, together with the font’s resource name on a given page, and that font is copied to all the pages in the input file’s range, and then written to the output file. -

    The font is named in the output file with its basefont name, so it can be easily used with +

    The font is named in the output file with its basefont name, so it can be easily used with -add-text. -

    For example, if the file

    For example, if the file fromfile.pdf has a font /GHLIGA+c128 with the name /F10 on page 1 @@ -2069,90 +2071,90 @@ class="cmtt-10">-list-fonts), the following would copy the in.pdf on all pages, writing the output to out.pdf: -

    -

    Text in this font can then be added by giving

    Text in this font can then be added by giving -font /GHLIGA+c128. Be aware that due to the vagaries of PDF font handling concerning which characters are present in the source font, not all characters may be available, or the encoding (mapping from input codes to glyphs) may be non-obvious. -

    +

    14.2 Removing Fonts

    -

    To remove embedded fonts from a document, use

    To remove embedded fonts from a document, use -remove-fonts. PDF readers will substitute local fonts for the missing fonts. The use of this function is only recommended when file size is the sole consideration. -

    -

    +

    14.3 Listing Missing Fonts

    -

    The

    The -missing-fonts operation lists any unembedded fonts in the document, one per line. -

    -

    The format is -

    The format is +

    -

    +

    Chapter 15
    Miscellaneous

    -

    15.1 Draft Documents

    -

    The

    The -draft option removes bitmap (photographic) images from a file, so that it can be printed with less ink. Optionally, the -boxes option can be added, filling the spaces left blank with a crossed box denoting where the image was. This is not guaranteed to be fully visible in all cases (the bitmap may be have been partially covered by vector objects or clipped in the original). For example: -

    -

    +

    15.2 Blackening Text, Lines and Fills

    -

    Sometimes PDF output from an application (for instance, a web browser) has text in colors which +

    Sometimes PDF output from an application (for instance, a web browser) has text in colors which would not print well on a grayscale printer. The -blacktext operation blackens all text on the given pages so it will be readable when printed. -

    This will not work on text which has been converted to outlines, nor on text which is part of a +

    This will not work on text which has been converted to outlines, nor on text which is part of a form. -

    -

    The

    The -blacklines operation blackens all lines on the given pages. -

    -

    The

    The -blackfills operation blackens all fills on the given pages. -

    -

    Contrary to their names, all these operations can use another color, if specified with

    Contrary to their names, all these operations can use another color, if specified with -color. -

    +

    15.3 Hairline Removal

    -

    Quite often, applications will use very thin lines, or even the value of 0, which in PDF means ”The +

    Quite often, applications will use very thin lines, or even the value of 0, which in PDF means ”The thinnest possible line on the output device”. This might be fine for on-screen work, but when printed on a high resolution device, such as by a commercial printer, they may be too faint, or disappear altogether. The -thinlines option prevents this by changing all lines thi <minimal thickness> to the given thickness. For example: -

    -

    +

    15.4 Garbage Collection

    -

    Sometimes incremental updates to a file by an application, or bad applications can leave data in a +

    Sometimes incremental updates to a file by an application, or bad applications can leave data in a PDF file which is no longer used. This function removes that unneeded data. -

    -

    +

    15.5 Change PDF Version Number

    -

    To change the pdf version number, use the

    To change the pdf version number, use the -set-version operation, giving the part of the version number after the decimal point. For example: -

    This does not alter any of the actual data in the file — just the supposed version number. -

    +

    15.6 Copy ID

    -

    The

    The -copy-id-from operation copies the ID from the given file to the input, writing to the output. -

    -

    If there is no ID in the source file, the existing ID is retained. You cannot use

    If there is no ID in the source file, the existing ID is retained. You cannot use -recrypt with -copy-id-from. -

    +

    15.7 Remove ID

    -

    The

    The -remove-id operation removes the ID from a document. -

    -

    You cannot use

    You cannot use -recrypt with -remove-id. -

    +

    15.8 List Spot Colours

    -

    This operation lists the name of any “separation” color space in the given PDF file. -

    This operation lists the name of any “separation” color space in the given PDF file. +

    -

    +

    15.9 Removing Dictionary Entries

    -

    This is for editing data within the PDF’s internal representation. Use with caution. -

    This is for editing data within the PDF’s internal representation. Use with caution. +

    -

    +

    15.10 Remove Clipping

    -

    The

    The -remove-clipping operation removes any clipping paths from the file. -

    -

    +

    Appendix A
    Dates

    Dates in PDF are specified according to the following format: -

    -

    A contiguous prefix of the parts above can be used instead, for lower accuracy dates. For +

    A contiguous prefix of the parts above can be used instead, for lower accuracy dates. For example: -

    diff --git a/html_manual/cpdfmanual.pdf b/html_manual/cpdfmanual.pdf index 6fc32f8..27a3764 100644 Binary files a/html_manual/cpdfmanual.pdf and b/html_manual/cpdfmanual.pdf differ diff --git a/html_manual/cpdfmanual.tex b/html_manual/cpdfmanual.tex index dacc16b..b9e0482 100644 --- a/html_manual/cpdfmanual.tex +++ b/html_manual/cpdfmanual.tex @@ -256,8 +256,8 @@ multiple programs, or multiple invocations of the same program. For example, thi \noindent\fbox{\parbox{\textwidth}{ \small\texttt{ cpdf in.pdf reverse -stdout |\\ - cpdf -stdin 1-5 -stdout |\\ - cpdf -stdin reverse -o out.pdf} + \phantom{\ }cpdf -stdin 1-5 -stdout |\\ + \phantom{\ }cpdf -stdin reverse -o out.pdf} }} @@ -297,7 +297,7 @@ one command, and the input specifier (e.g filename) of the next. For instance: \noindent\fbox{\parbox{\textwidth}{ \small\texttt{cpdf -merge in.pdf in2.pdf AND -add-text "Label"}\\ - \noindent\small\texttt{ AND -merge in3.pdf -o out.pdf} + \noindent\small\texttt{\vphantom{\ \ \ \ \ } AND -merge in3.pdf -o out.pdf} \vspace{2.5mm} \noindent Merge \texttt{in.pdf} and \texttt{in2.pdf} together, add text to both pages, append \texttt{in3.pdf} and write to \texttt{out.pdf}. @@ -308,7 +308,7 @@ one command, and the input specifier (e.g filename) of the next. For instance: \noindent\fbox{\parbox{\textwidth}{ \small\texttt{cpdf -merge in.pdf in2.pdf AND -range 2-4 -add-text "Label"}\\ - \noindent\small\texttt{ AND -merge in3.pdf -o out.pdf} + \noindent\small\texttt{\vphantom{\ } AND -merge in3.pdf -o out.pdf} }} @@ -332,7 +332,7 @@ supported: -\noindent For example, one may write \texttt{14mm} or \texttt{21.6in}. In addition, the following letters stand, in some operations (\texttt{-scale-page}, \texttt{-scale-to-fit}, \texttt{-scale-contents}, \texttt{-shift}, \texttt{-mediabox},\\ \texttt{-crop}) for various page dimensions: +\noindent For example, one may write \texttt{14mm} or \texttt{21.6in}. In addition, the following letters stand, in some operations (\texttt{-scale-page}, \texttt{-scale-to-fit}, \texttt{-scale-contents}, \texttt{-shift}, \texttt{-mediabox}, \texttt{-crop}) for various page dimensions: \begin{table}[h] \centering @@ -761,7 +761,7 @@ The encryption parameters described in Chapter \ref{encryption} may be added to \vspace{1.5mm} \small\noindent\texttt{cpdf -scale-to-fit " " [-scale-to-fit-scale ]}\\ - \noindent\texttt{ in.pdf [] -o out.pdf} + \noindent\texttt{{}\vphantom{\ } \vphantom{\ } \vphantom{\ } \vphantom{\ } \vphantom{\ } in.pdf [] -o out.pdf} \vspace{1.5mm} \small\noindent\texttt{cpdf -scale-contents [] [] in.pdf [] -o out.pdf} @@ -798,7 +798,7 @@ The encryption parameters described in Chapter \ref{encryption} may be added to \vspace{1.5mm} \small\noindent\texttt{cpdf -frombox -tobox [-mediabox-if-missing]} \\ - \noindent\texttt{ in.pdf [] -o out.pdf} + \noindent\texttt{\vphantom{\ } \vphantom{\ } \vphantom{\ } \vphantom{\ } \vphantom{\ } in.pdf [] -o out.pdf} }} @@ -842,7 +842,7 @@ Y factors given. This scales both the page contents, and the page size itself. I \noindent\fbox{\parbox{\textwidth}{ - \small\noindent\texttt{cpdf -scale-to-fit "297mm 210mm" in.pdf -o out.pdf} + \small\noindent\texttt{cpdf -scale-to-fit "297mm 210mm" in.pdf -o out.pdf}\\ \small\noindent\texttt{cpdf -scale-to-fit a4portrait in.pdf -o out.pdf} \vspace{2.5mm} @@ -1016,7 +1016,7 @@ existing crop box, use \texttt{-remove-crop}. \noindent\fbox{\parbox{\textwidth}{ \small\noindent\texttt{cpdf -frombox -tobox [-mediabox-if-missing]} \\ - \noindent\texttt{ in.pdf [] -o out.pdf} + \noindent\texttt{{}\phantom{cpdf} in.pdf [] -o out.pdf} \vspace{2.5mm} \noindent Copy the contents of one box to another. @@ -1038,7 +1038,7 @@ existing crop box, use \texttt{-remove-crop}. \index{decryption} \noindent\fbox{\parbox{\textwidth}{ \small\noindent\texttt{cpdf -encrypt }\\ - \noindent\texttt{ [-no-encrypt-metadata] in.pdf -o out.pdf} + \noindent\texttt{\phantom{cpdf }[-no-encrypt-metadata] in.pdf -o out.pdf} \vspace{1.5mm} \noindent\texttt{cpdf -decrypt in.pdf owner= -o out.pdf} @@ -1152,6 +1152,7 @@ PDF, use: \section{Compressing a Document} \index{compressing} To compress the streams in a PDF file, use: + \noindent\fbox{\parbox{\textwidth}{ \small\texttt{cpdf -compress in.pdf -o out.pdf} }} @@ -1212,6 +1213,7 @@ particular bookmark is. Then the text of the bookmark in quotes, then the page number which the bookmark points to, then (optionally) the word "open" if the bookmark should have its children (at the level immediately below) visible when the file is loaded. For example, upon executing + \noindent\fbox{\parbox{\textwidth}{ \small\texttt{cpdf -list-bookmarks doc.pdf} @@ -1237,6 +1239,7 @@ the ASCII range. To prevent this, and return unicode UTF8 output, add the \label{removebookmarks} \index{bookmarks!removing} The \texttt{-remove-bookmarks} operations removes all bookmarks from the file. + \noindent\fbox{\parbox{\textwidth}{ \small\texttt{cpdf -remove-bookmarks in.pdf -o out.pdf} @@ -1265,9 +1268,9 @@ tree with no entry being more than one greater than the last). \small\noindent \texttt{cpdf -presentation in.pdf [\textlangle range\textrangle ] -o out.pdf}\\ - \texttt{ [-trans \textlangle\ transition-name\textrangle ] [-duration \textlangle\ float\textrangle\ ]}\\ -\texttt{ [-vertical] [-outward] [-direction \textlangle\ int \textrangle]}\\ -\texttt{ [-effect-duration \textlangle\ float \textrangle ]}\\ + \texttt{\phantom{cpdf} [-trans \textlangle\ transition-name\textrangle ] [-duration \textlangle\ float\textrangle\ ]}\\ +\texttt{\phantom{cpdf} [-vertical] [-outward] [-direction \textlangle\ int \textrangle]}\\ +\texttt{\phantom{cpdf} [-effect-duration \textlangle\ float \textrangle ]}\\ }} \index{presentations} @@ -1346,35 +1349,35 @@ the file using a different page range each time. \noindent\fbox{\parbox{\textwidth}{ \noindent\small\texttt{cpdf -stamp-on source.pdf}\\ - \noindent\small\texttt{ [-scale-stamp-to-fit] [\textlangle positioning command\textrangle ] [-relative-to-cropbox] }\\ - \noindent\small\texttt{ in.pdf [\textlangle range\textrangle ] -o out.pdf}! + \noindent\small\texttt{\phantom{cpdf} [-scale-stamp-to-fit] [\textlangle positioning command\textrangle ] [-relative-to-cropbox] }\\ + \noindent\small\texttt{\phantom{cpdf} in.pdf [\textlangle range\textrangle ] -o out.pdf}! \vspace{1.5mm} \noindent\small\texttt{cpdf -stamp-under source.pdf}\\ - \noindent\small\texttt{ [-scale-stamp-to-fit] [\textlangle positioning command\textrangle ] [-relative-to-cropbox]}\\ - \noindent\small\texttt{ in.pdf [\textlangle range\textrangle ] -o out.pdf} + \noindent\small\texttt{\phantom{cpdf} [-scale-stamp-to-fit] [\textlangle positioning command\textrangle ] [-relative-to-cropbox]}\\ + \noindent\small\texttt{\phantom{cpdf} in.pdf [\textlangle range\textrangle ] -o out.pdf} \vspace{1.5mm} \noindent\small\texttt{cpdf -combine-pages over.pdf under.pdf -o out.pdf} \vspace{1.5mm} - \noindent\small\texttt{cpdf ([-add-text \textlangle text-format\textrangle | -add-rectangle\\\textlangle size\textrangle ])}\\ - \texttt{[-font \textlangle fontname\textrangle ]}\\ - \texttt{[-font-size \textlangle size-in-points\textrangle ]}\\ - \texttt{[-color \textlangle color\textrangle ]}\\ - \texttt{[-line-spacing \textlangle number \textrangle ]}\\ - \texttt{[-outline]}\\ - \texttt{[-linewidth \textlangle number\textrangle ]}\\ - \texttt{[-underneath]}\\ - \texttt{[-relative-to-cropbox]}\\ - \texttt{[-prerotate]}\\ - \texttt{[-bates \textlangle number\textrangle ]}\\ - \texttt{[-bates-at-range \textlangle number\textrangle ]}\\ - \texttt{[-bates-pad-to \textlangle number\textrangle ]}\\ - \texttt{[-opacity \textlangle number\textrangle ]}\\ - \texttt{[-midline]}\\ - \texttt{[-topline]}\\ - \texttt{in.pdf [\textlangle range\textrangle ] -o out.pdf}\\ + \noindent\small\texttt{cpdf ([-add-text \textlangle text-format\textrangle | -add-rectangle \textlangle size\textrangle ])}\\ + \phantom{cpdf} \texttt{[-font \textlangle fontname\textrangle ]}\\ + \phantom{cpdf} \texttt{[-font-size \textlangle size-in-points\textrangle ]}\\ + \phantom{cpdf} \texttt{[-color \textlangle color\textrangle ]}\\ + \phantom{cpdf} \texttt{[-line-spacing \textlangle number \textrangle ]}\\ + \phantom{cpdf} \texttt{[-outline]}\\ + \phantom{cpdf} \texttt{[-linewidth \textlangle number\textrangle ]}\\ + \phantom{cpdf} \texttt{[-underneath]}\\ + \phantom{cpdf} \texttt{[-relative-to-cropbox]}\\ + \phantom{cpdf} \texttt{[-prerotate]}\\ + \phantom{cpdf} \texttt{[-bates \textlangle number\textrangle ]}\\ + \phantom{cpdf} \texttt{[-bates-at-range \textlangle number\textrangle ]}\\ + \phantom{cpdf} \texttt{[-bates-pad-to \textlangle number\textrangle ]}\\ + \phantom{cpdf} \texttt{[-opacity \textlangle number\textrangle ]}\\ + \phantom{cpdf} \texttt{[-midline]}\\ + \phantom{cpdf} \texttt{[-topline]}\\ + \phantom{cpdf} \texttt{in.pdf [\textlangle range\textrangle ] -o out.pdf}\\ \noindent See also positioning commands below. @@ -1490,6 +1493,7 @@ font size and color. \index{bates numbers} Unique page identifiers can be specified by putting \verb!%Bates! in the format. The starting point can be set with the \texttt{-bates} option. For example: + \noindent\fbox{\parbox{\textwidth}{ \small\texttt{cpdf -add-text "Page ID: \%Bates" -bates 23745 in.pdf -o out.pdf} @@ -1655,7 +1659,7 @@ bottom, bottom left or bottom right). \noindent\fbox{\parbox{\textwidth}{ \small\texttt{cpdf -add-text "Specification\textbackslash n\%Page of \%EndPage"\\ - -topright 10 in.pdf -o out.pdf} + \phantom{cpdf} -topright 10 in.pdf -o out.pdf} }} @@ -1669,7 +1673,7 @@ spacing, where a spacing of 1 is the standard. \noindent\fbox{\parbox{\textwidth}{ \small\texttt{cpdf -add-text "Specification\textbackslash n\%Page of \%EndPage"\\ - -topright 10 -line-spacing 1.5 in.pdf -o out.pdf} + \phantom{cpdf} -topright 10 -line-spacing 1.5 in.pdf -o out.pdf} }} @@ -1682,7 +1686,7 @@ for positions relative to the center of the page. For example: \noindent\fbox{\parbox{\textwidth}{ \small\texttt{cpdf -add-text "Long line\textbackslash nShort" -justify-right\\ - in.pdf -o out.pdf} + \phantom{cpdf} in.pdf -o out.pdf} }} @@ -1711,7 +1715,7 @@ A rectangle may be placed on one or more pages by using the \texttt{-add-rectang \noindent\fbox{\parbox{\textwidth}{ \small\texttt{cpdf -add-rectangle "200 300" -pos-right 30 -color red -outline\\ - in.pdf -o out.pdf} + \phantom{cpdf} in.pdf -o out.pdf} }} This can be used to blank out or highlight part of the document. The following positioning options work as you would expect: \texttt{-topleft}, \texttt{-top}, \texttt{-topright}, \texttt{-right}, \texttt{-bottomright}, \texttt{-bottom}, \texttt{-bottomleft}, \texttt{-left}, \texttt{-center}. When using the option \texttt{-pos-left "x y"}, the point (x, y) refers to the bottom-left of the rectangle. When using the option \texttt{-pos-right "x y"}, the point (x, y) refers to the bottom-right of the rectangle. When using the option \texttt{-pos-center "x y"}, the point (x, y) refers to the center of the rectangle. The options \texttt{-diagonal} and \texttt{-reverse-diagonal} have no meaning.\pagestyle{empty}\thispagestyle{fancy} @@ -1875,11 +1879,11 @@ given page range. \vspace{1.5mm} \small\noindent\texttt{cpdf -hide-toolbar \textlangle true | false\textrangle in.pdf -o out.pdf}\\ - \noindent\texttt{ -hide-menubar}\\ - \noindent\texttt{ -hide-window-ui}\\ - \noindent\texttt{ -fit-window}\\ - \noindent\texttt{ -center-window}\\ - \noindent\texttt{ -display-doc-title} + \noindent\texttt{\phantom{cpdf} -hide-menubar}\\ + \noindent\texttt{\phantom{cpdf} -hide-window-ui}\\ + \noindent\texttt{\phantom{cpdf} -fit-window}\\ + \noindent\texttt{\phantom{cpdf} -center-window}\\ + \noindent\texttt{\phantom{cpdf} -display-doc-title} \vspace{1.5mm} \small\noindent\texttt{cpdf -open-at-page \textlangle page number\textrangle in.pdf -o out.pdf}\\ @@ -1892,8 +1896,8 @@ given page range. \vspace{1.5mm} \small\noindent\texttt{cpdf -add-page-labels in.pdf -o out.pdf}\\ - \noindent\texttt{ [-label-style \textlangle style\textrangle ] [-label-prefix \textlangle string\textrangle ]}\\ - \noindent\texttt{ [-label-startval \textlangle integer\textrangle ]}\\ + \noindent\texttt{\phantom{cpdf} [-label-style \textlangle style\textrangle ] [-label-prefix \textlangle string\textrangle ]}\\ + \noindent\texttt{\phantom{cpdf} [-label-startval \textlangle integer\textrangle ]}\\ \vspace{1.5mm} \small\noindent\texttt{cpdf -remove-page-labels in.pdf -o out.pdf}\\ @@ -2183,12 +2187,12 @@ i, ii, iii, iv, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, A-0, A-1, A-2, A-3, A-4, A-5 \noindent\fbox{\parbox{\textwidth}{ \noindent\texttt{cpdf -add-page-labels in.pdf 1-4 -label-style LowercaseRoman}\\ - \noindent\texttt{ -o out.pdf}\\ + \noindent\texttt{\phantom{cpdf} -o out.pdf}\\ \noindent\texttt{cpdf -add-page-labels out.pdf 5-14 -o out.pdf}\\ \noindent\texttt{cpdf -add-page-labels out.pdf 15-20 -label-prefix "A-"}\\ - \noindent\texttt{ -label-startval 0 -o out.pdf} + \noindent\texttt{\phantom{cpdf} -label-startval 0 -o out.pdf} }} \noindent By default the labels begin at page number 1 for each range. To override this, we can use \texttt{-label-startval} (we used $0$ in the final command), where we want the numbers to begin at zero rather than one. @@ -2305,7 +2309,7 @@ To list all document- and page-level attachments, use the \texttt{-list-attached \noindent\fbox{\parbox{\textwidth}{ \noindent\texttt{cpdf -copy-font fromfile.pdf -copy-font-page }\\ - \noindent\texttt{ -copy-font-name in.pdf [] -o out.pdf} + \noindent\texttt{\phantom{cpdf} -copy-font-name in.pdf [] -o out.pdf} \vspace{1.5mm} \noindent\texttt{cpdf -remove-fonts in.pdf -o out.pdf} @@ -2333,7 +2337,7 @@ the name \verb!/F10! on page 1 (this information can be found with \noindent\fbox{\parbox{\textwidth}{ \small\noindent\texttt{cpdf -copy-font fromfile.pdf -copy-font-name /F10}\\ - \small\noindent\texttt{ -copy-font-page 1 in.pdf -o out.pdf} + \small\noindent\texttt{\phantom{cpdf} -copy-font-page 1 in.pdf -o out.pdf} }} \noindent Text in this font can then be added by giving \verb!-font /GHLIGA+c128!. Be