PDF Booklet https://pdfbooklet.sourceforge.io/wordpress Manage your PDF printouts Sat, 13 Feb 2021 13:02:52 +0000 en-US hourly 1 https://wordpress.org/?v=5.6 Tweak the “ini” file – Advanced transformations https://pdfbooklet.sourceforge.io/wordpress/2020/12/24/tweak-the-ini-file-advanced-transformations/ Thu, 24 Dec 2020 11:45:20 +0000 https://pdfbooklet.sourceforge.io/wordpress/?p=223
Read More]]> Advanced transformations are possible by directly editing the ini files. To prevent unwanted overwrite it is highly recommended not to use an automatically generated ini file without renaming it. You can use it as a model, but rename it to be sure the program will not overwrite it each time you generate a PDF output, if the option «Save ini files» with PDF is active.

General principle

You can add three special sections :

SectionExplanationExample
pagesDefine here the pages to which some transformation will be applied1,2 = mytrans1 5 = mytrans2,mytrans3 2:6 =mytrans3 @8 = mytrans1
conditionsPython code which will select some source pagesodd = page_number % 2 == 0 => mytrans2
output_conditionsPython code which will select some output pagesodd = page_number % 2 == 0 => mytrans2

Then you can add other sections with the names you want, and define in them the transformations you want. In our example, you should have the sections mytrans1,mytrans2, mytrans3.

Procedure

Important recommendation: If you start from a generated ini file (your_file.PDF.ini), rename it before editing. If you don’t rename it, it will be overwritten each time you generate a new PDF. It should do no harm, but we cannot guarantee that you will never loose your modifications. It is much safer to rename it so that it is saved only when you explicitly asks (by the save project menu).

Several procedures are possible

    1. Copy and rename a generated ini file,
    2. Add the desired sections,
    3. Load this file and generate the PDF.
    1. Create a small ini file with only the necessary sections,
    2. Open a PDF file,
    3. open the ini file (with the open project menu),
    4. Generate the PDF.

The second procedure is interesting if your transformations must be applied to different files.

Modifying: Tweaking the transformations takes time. When you edit the ini file, you don’t need to close the program. Just reload the ini file and generate your PDF.

[pages]

  • Multiple transformations separated by a comma are allowed.
  • Source pages may be referenced:
    • by their position on the sheet (row, column), example: 1,2
    • or by the page number, example: 10
    • if there are several source files, precise the file first: 2:10 (means page 10 of the second file)
  • Output pages are referenced by a @ followed (without space) by the output page number. Example @ 8

[conditions]

This sections is more technical. The pages are chosen by a python code. Presently the only usable variable is page_number.

Examples:

page_number % 2 == 0Selects even pages
page_number % 2 == 1Selects odd pages
page_number % 3 == 0Selects every third page
page_number in (2,7,8,25)Selects pages 2,7,8 and 25
page_number > 10Selects from page 10 and above
page_number % 2 == 0 and page_number > 10 and page_number < 25Selects event pages between 11 and 24

Note on Python syntax:

  • The code will be the clause of an if statement. It must return True for the pages you want. The full resulting code for the first example is:
    if (page_number % 2 == 0):
    …
    The double = is necessary, it is not an operator but a comparator. A single = will raise an error, it is invalid inside an if statement.
  • % is the Python operator for modulo
  • For sophisticated formulas, parenthesis are recommended.

Syntax of the line

The syntax is a bit complicated, sorry.

  • First part: a name which is just informational and not used by the program, followed by =
  • Second part: The python formula, followed by =>
  • Third part: the transformation(s).
    Multiple transformations separated by a comma are allowed.

Example:

even = output_page_number % 2 == 0 => rotate180

Transformations:

Transformations are defined in sections which you create, giving them the name you want. The sections can contain the following lines:

htranslate<value>
(in mm)
a positive number shifts to the right, a negative number shifts to the left
vtranslate<value>
(in mm)
a positive number shifts up, a negative numbre shifts down
rotate<value>
(in degrees)
handles this problem: the program calculates the proper Htranslate and Vtranslate to insure a rotation centered on the center of the page.
pdfrotate<value>
(in degrees)
original PDF rotation: the center is the lower left corner. This is tricky: if you rotate 90° or 180° or -90°, your page may no longer be visible ! You have to use Vtranslate and Hrotate to position it correctly.
scale<value>
(in %)
matrix<value>This highly technical option allows you to enter here a transformation matrix. Use it only if you know what is a transformation matrix in PDF!! See the section on transformation matrices in the Adobe PDF reference guide.
globalrotation<value>
(90, 180 or 270)
handles also the problem. Only three values are valid: 90, 180 and 270.

Warning: “Globalrotation” parameter is incompatible with all others because it uses a totally different process. Hence it must be alone in its section. If there are other parameters in the section, they will be ignored.

Warning: “Matrix” this parameter is incompatible with all others because it will overwrite all other transformation. Hence it must be alone in its section. If there are other parameters in the section, they will be ignored.

Example 1

[pages]
1,1 = 125%, test1 

[test1]
Htranslate=140
Vtranslate=45
Rotate=10

[125%]
Scale = 125

This example will apply the transformations defined in test1 and 125% to all pages situated in the first column of the first row.

Example 2

[pages]
3 = 90
5 = 180
[90]
Rotate = 90
[180]
Rotate = 180

This example will rotate the page 3 of 90° and the page 5 of 180°

Although it is valid to mix the two modes for page selection, you must be aware that they may be applied to the same page which may end in undesired result. Example:

[pages]
1,1 = 180
1 = 180
[180] 
cRotate = 180

This will result in all left pages but the first one to be rotated 180°. The first one will be rotated twice (180 + 180).

Transformations defined by row, column are applied first, transformations defined for the page number are applied after.

Warning: The order of transformations may be significant. Try and see. There is some information on this last point in the Adobe PDF reference guide (see the section on transformation matrices). But note that if you want to control the order of transformations, you must use different sections because in a section, transformations are always treated in this order, despite the order of the lines: Rotate, Scale, Translate. Note also that you cannot use the same transformation twice in a section.

]]>
Use the main window – “Options” https://pdfbooklet.sourceforge.io/wordpress/2020/12/24/use-the-main-window-options/ Thu, 24 Dec 2020 11:45:20 +0000 https://pdfbooklet.sourceforge.io/wordpress/?p=220
Read More]]> The Options tab gives access to advanced features:

Leading blank pages: number of blank pages to add in the beginning of the document. This is intended for traditional binding which requires blank pages in the beginning and the end.

Trailing blank pages: number of blank pages to add in the end of the document.

Right to left: For languages written from right to left, like Hebrew or Arabic, the layout must be mirrored.

Reference page: This is an important feature: by default the program takes the size of page 1 as reference to calculate the output size. If your document has pages of different sizes, this may lead to undesired results. A common example is Google books: There is always in the beginning of the file two information pages which are in Letter format. The book after that may have very different sizes, and most of the time it is not in letter size. If you need to control the size of the output page, you may have to use this parameter to indicate the proper reference page (3 for Google books, or even more than 3 in case the cover page has also a special size).

Output

The Output frame in the Options tab gives you control on some aspects of the output file.

Output file name: By default, PDF-Booklet creates the output file name by adding -bklt.PDF to the file name (without the extension) of the source file name. If this does not meet your needs you can change this behavior here.

In the Output file field, you may choose a file, but this is not recommended because the file will be overwritten. But it may be used if you have a file that you generally use for your tests and which can be overwritten.

The normal way is to use parameters as in the default shown above :

The %F code will be replaced by the actual file path and name, without the extension, then -bklt.PDF is added to it.

You can change this, but it must be noted that the %F parameter can be used only in the beginning of the output file name because it is replaced by the full path, including the drive letter (or the / in Linux).

Other possible codes:

  • %P: Path
  • %N: Name
  • %B : Basename
  • %E: Extension

Let your mouse on the Text field to get a tooltip:

Example: if the source file is D:\My Documents\PDF files\testfile.PDF

Then:

  • %F = D:\My Documents\PDF files\testfile
  • %P = D:\My Documents\PDF files\
  • %N = testfile.PDF
  • %B = testfile
  • %E = PDF
  • Show PDF: if checked, the PDF file generated will be opened automatically at the end of the process
  • Save settings with PDF: if checked, when a file is generated, an ini file is created with the settings you have used. Later if you want to do the same process on the same file (or use the same settings for another file) you will not have to start again all your tuning. This important when you have made sophisticated transformations.
  • Overwrite output files: if checked, there will be no warning if the output file already exists. Note that you may still have a warning if the output file is already opened in Adobe Reader, because it cannot be overwritten in this case.
  • Don’t compress output: Today PDF files are generally compressed. In case you want to have a look at the content, you can check this. Note that this will let uncompressed only the content which pyPDF has manipulated. Many resources will be still compressed. This is a very technical option.
]]>
Use the main window – “Global transformations” https://pdfbooklet.sourceforge.io/wordpress/2020/12/24/use-the-main-window-global-transformations/ Thu, 24 Dec 2020 11:45:20 +0000 https://pdfbooklet.sourceforge.io/wordpress/?p=217
Read More]]> The Global transformations tab lets you apply transformations similar to those explained above (see 5. Transformations) to the Output page as a whole. To add transformations for the individual source pages you have placed on your output page, use the Transformations tab.

Horizontal ShiftWill move the page right (positive value) or left (negative value).
Vertical ShiftWill move the page upper (positive value) or lower (negative value).
These values are in mm. Decimal values allowed 25.33 means 25.33 mm.
ScaleWill enlarge or reduce the page.
Values are in %. The fix point is the center of the page
Scale horizontally or verticallyWill enlarge or reduce in one direction only
RotationWill rotate the whole content of the output page
Flip horizontally or verticallyWill turn the page

You may have to click update under the Preview to have the Preview updated. This happens when you type a value and don’t use the arrows.

The Reset button will restore the default values ( = no change).

Global rotation

This point may be difficult to explain with words, but the example will help. The Pddf format has two different mechanisms for rotation. One is applied to the content. It really rotates the content, and you can rotate the angle you want. Another is applied to the page itself, not the content of the page (just as if you turned the sheet of paper) and has only four possible values: 0, 90, 180, 270.

You will notice that Output Page Transformations rotates counter clockwise and Global Rotation rotates clockwise. We are not responsible of that, this is how PDF works and there is a reason for it: The first system is an internal process and uses the standard of trigonometry which rotates counter clockwise. The second process is user oriented and it is more natural for humans to think of a clockwise rotation (this is purely cultural, indeed).

It is not possible to select the domain here, transformations are applied to all pages. In case you would need to apply transformations to a set of pages (for instance Odd pages only), the procedure is simple:

  • Once your layout is ready, create the PDF file.
  • Open the generated PDF file in PDFBooklet
  • Select the “One page” disposition
  • Use the Transformations tab to make the changes you need, after having selected “Odd pages”
]]>
Use the main window – “Transformations” https://pdfbooklet.sourceforge.io/wordpress/2020/12/24/use-the-main-window-transformations/ Thu, 24 Dec 2020 11:45:20 +0000 https://pdfbooklet.sourceforge.io/wordpress/?p=215
Read More]]> The transformations tab is very important. It gives you all the controls to fine tune your documents.

Since the result of what you do here is immediately visible, it is not useful to explain all in details. Here is a possible example, just to show what is possible:

Note that before applying transformations, you must choose the pages to which they will be applied. This means:

  1. Select a page by clicking it
  2. Select an option in the “Domain” frame.

The first option, “All pages in this position” means that if the selected page was the right one, as in our example, all right pages will be modified. If you had a alyout with 4 pages and select the top right page, all top right pages will be modified.

“This page only” should be self-explanatory

“Even page” and “Odd pages” are normally useful in a one page layout. But they can be used in any type of layout. As their name indicates, all even pages or all odd pages will be modified. The selected page does not matter with these options.

The Apply Button will apply the changes but is generally not necessary, because most of the time updating is automatic. But there are some exceptions.

LIMITATIONS: It is not yet possible to select several pages, you must modify them one at a time but remember that if This page only is not selected, transformations applied to a page will be applied to all pages which are in the same position.

You can copy and paste transformations: right click on a page to get a context menu.

You can paste transformations to a different domain. Example: copy the transformations applied to a single page and paste to Even pages, or all pages in a given position. Just choose the right page and the right domain before pasting.

The “Standard Transformations” option offers you a shortcut for common rotations:

Custom transformations are not yet implemented.

]]>
Use the main window https://pdfbooklet.sourceforge.io/wordpress/2020/12/24/use-the-main-window/ Thu, 24 Dec 2020 11:45:20 +0000 https://pdfbooklet.sourceforge.io/wordpress/?p=210
Read More]]> The main window is divided in two: the commands on the left, and the preview on the right. This preview shows an exact result of your settings. The output is calculated by the same process which will produce the definitive output. You can resize the window to have a larger preview (try full screen).

You can select a page by clicking it. It will be surrounded by a red frame (see examples above in the quick discovery.

At the bottom of the preview there is a toolbar:

LabelFunction
<<First page
<Previous page
>Next page
>>Last page
UpdateUpdate the preview (mostly automatic, but not always)
TransformationsOpens the transformations window
GoGenerates the output file

On the right, the program indicates the total page count of the output file and the number of pages already generated. Generation speed may vary hugely depending on the content of your output file: Very fast when you work on a single file (up to 100 pages / s) it may be much slower when the program must merge pages from different files in the same sheet (it may be as low as 2 pages).

]]>
Use the main window – “Disposition” https://pdfbooklet.sourceforge.io/wordpress/2020/12/24/use-the-main-window-disposition/ Thu, 24 Dec 2020 11:45:20 +0000 https://pdfbooklet.sourceforge.io/wordpress/?p=199
Read More]]> In this tab you define the general disposition of your output page: booklet (or booklets) or only multiple pages on a single sheet. Just click the different options to see what they do.

Booklets (Single or Multiple)

In this mode the number of columns must always be a multiple of 2. Other values will be corrected by the program. If you indicate more than 1 for the rows, or more than 2 for the columns, you will have multiple copies of the same pair of pages. This is useful if you have an A6 format booklet and you want to print two copies on an A4 page (A5 for both pages, A4 for two copies).

The Single Booklet option will create one booklet from the whole file. If you select Multiple Booklets, You can define the maximum number of leafs (sheets of paper) for a booklet. Suppose you have a 60 pages document and you keep the default value (5), you will get 3 booklets of 20 pages (5 x 4) each: 1-20, 21-40, 41-60. The program will add the needed blank pages and try to equilibrate the booklets. If your document has 43 pages, a blank page will be added, and instead of making two booklets of 5 sheets of paper and 1 of 1 sheet, the program will reduce to 4 sheets the first two booklets, and the remaining booklet will have 3 sheets: 1-16, 17-32, 33-44.

Type Book or Calendar will define if the pages are positioned left-right or top-bottom.

Multiple pages

The three following options (2 pages, x pages in line, x pages in columns) are variants of the same process: place a given number of pages of the source file in a single page of the output page. 2 pages is the same thing as x pages in line with 1 line and 2 columns. Pages can be set in lines or in columns:

Multiple copies

x copies will place multiple copies of the same source page in the output page. The total number depends on the number of rows and columns you define.

Step:

By default, when you select this option, step is set to 1. If you define step to y, you will get multiple copies of sets of y pages of your document. An example will show you what this means: Below you have the result with step = 1 on the left, step = 3 on the right.

If it is not clear for you, try with different values for step and see the result. It will be more clear than a long explanation.

One page

This option is used when you want to extract pages from a PDF file or to merge several PDF files (or pages from these files) in a single PDF file.

User defined

This is an advanced option which allows you to define the layout of pages on the sheet. When you click on this option, a small window opens:

Enter here the order in which pages must be placed on the output sheet. Follow theses rules:

  1. One line for each row of pages
  2. Comma separated
  3. If you repeat a number, the page will be placed multiple times on the sheet. In this case you should define the step. See explanations below
  4. You can create a blank page by entering a b
  5. You are responsible to enter here coherent data. Each line must have the same number of “pages”
  6. Numbers entered here are not page numbers. They indicate only the order in which the pages will be placed on the sheet. (In the examples below they do correspond for easier understanding, but this is only a particular case, first page of an unmodified PDF).

Some examples below.

Normal case

1,3,5,7
2,4,6,8
You may have as many rows and columns you want

1,3,5
7,9,11
2,4,6
8,10,12
Pages repeated

1,2,1,4
3,4,2,3
Blank pages

1,b,b,2
b,3,4,b

The step parameter

If you repeat pages in your layout, like this example:

1,2,1,2
3,4,3,4

Then if you leave the parameter “Step” to “Automatic”, the program will calculate the step on the base of the total number of pages. In this case it will be 8 (2 x 4). This means that the first sheet will contain pages 1 to 8, and the second will contain pages 9 to 16. The result will be is:

First sheetSecond sheet
1,2,1,2 3,4,3,49,10,9,10 11,12,11,12

And pages 5,6,7, and 8 will never be displayed, which is surely not what you expect!

So you MUST indicate that the step is 4 and then you will get:

First sheetSecond sheetThird sheet
1,2,1,2 3,4,3,45,6,5,6 7,8,7,89,10,9,10 11,12,11,12

Output size


In the disposition tab you find also the frame Output size. This frame allows you to indicate the size you want for the output page.

  • Auto: With this option, no scaling is done. The size of the output page will be a multiple of the size of the source page (of the reference page to be precise ; See the description of the Options tab to find an explanation about the reference page). If your source file has A5 pages, and you have chosen the option booklets with one row, then the output page size will be A4. If you had selected multiple pages with two rows and two columns, then the output page will be A3. And so on.
  • No change: The output page size will be the same as the source page ( of the reference page to be precise ; See the description of the Options tab to find an explanation about the reference page). Whatever your selection about rows and columns, if your source file has A5 pages, your output pages will be A5 and the pages you place on it will be scaled.
  • User defined: Define here the value you want (Width first and then Height) if the previous options don’t meet your needs. Please, be careful that you will probably have to adjust the scale to get the result you want. This option is powerful but less easy to use.

Auto Scale : This option is normally checked and have a precise signification that you must understand : If you have source pages of different sizes, it will insure that each page is scaled to fit in the place reserved to it in the output page. An example will be more clear than this explanation. Suppose we are merging two files, one in A5 format and the other in A4. If auto scale is on, there is no problem:

The right page, which is in A4 in the source file, is correctly positioned.

If Auto scale is off, this page will not be scaled and it will not fit in its place, it will be croped:

In some particular situations it may be useful to set auto scale off, but this is rather uncommon.

There is presently no option to insure an automatic scaling of the whole page in case you choose the user defined option. This may be added in a next version.

]]>
Use the menu – “Pages” https://pdfbooklet.sourceforge.io/wordpress/2020/12/24/use-the-menu-pages/ Thu, 24 Dec 2020 09:43:52 +0000 https://pdfbooklet.sourceforge.io/wordpress/?p=197
Read More]]> The Pages menu lets you select the pages. If you don’t want to include all pages in the output file, use the pages selector to select and organize your pages:

  • move pages at a different place (with drag and drop)
  • delete pages (right click)
  • add blank pages (right click)

The pages selector is in fact the program PDF-Shuffler, written by Konstantinos Poulios, which is opened inside PDF-Booklet. You can also use PDF-Shuffler independently, PDF-Booklet installer has created an icon for it.

You can delete several pages simultaneously. Use CTRL or SHIFT as usual to select several pages, then right click and select Clear.

You can move pages with drag and drop.

Moving several pages simultaneously is possible. When you click on the selection to drag it, the selection disappears, but all the selected pages will be moved nevertheless.

TRICK: When you move a single page, if you click and then drag without releasing the button, the image of the page is moved also and it may be difficult to see the exact place of the drop. To prevent this, click once to select your page, then click again to drag and drop, the image will not move and drop is easier.

You can adjust the scale with the slider on top of the screen:

Sometimes it may be easier to edit directly the pages list. And it is more secure if you are modifying the pages several times.

Use the menu Pages / Edit Page List for this purpose:

You can use:

  • Page numbers
  • Pages range separated by – (example: 1-20)
  • b to indicate that a blank page must be added.
  • #b (example: 5b) to add 5 blank pages.

All elements of your selection can be placed on different lines or can be separated by commas.

1-10, b, 24

or:

1-10
b
24

will give the same result.

Pages can be listed in any order. You can list the same page multiple times, and ranges can overlap. Although a nonsense, the following selection is perfectly valid:

20-50, 1-10, 5, 5, 6-40

If you have selected multiple files, for all files but the first, you must indicate the number of the file followed by a colon. Example 2: for the second file.

You can use 1: for the first file, but this is not necessary since 1: is the default. Example:

1-10
2:4
1:7
2:22-50
]]>
Use the menu – “Projects” https://pdfbooklet.sourceforge.io/wordpress/2020/12/24/use-the-menu-projects/ Thu, 24 Dec 2020 09:39:28 +0000 https://pdfbooklet.sourceforge.io/wordpress/?p=190
Read More]]> When you have worked on some file(s) and made some delicate adjustments, it is recommended to save all the settings with it otherwise if you want, later, to modify something, you will have to do the job all over again.

You can do this in two ways: Automatically, by checking the option Save settings with PDF in the Options tab. When this option is checked, each time you create a PDF file, an ini file with the same name that the PDF file + “ini” is created in the same directory. If you move the PDF file, remember to move also the corresponding ini file. You can also use the Save Project menu. The Open Project menu lets you reload an ini file. The ini file includes the list of files, the pages selected, and the transformations done on the pages. The ini file is human readable and you can open it to see what were the settings used.

Saving a project is also useful when your work on a set of files is unfinished.

NOTE: We do not recommend the use of the automatically generated ini file to manage a project. This file may be overwritten when you are unaware of it. It is better to create a project file with a different name.

]]>
Use the menu – “Files” https://pdfbooklet.sourceforge.io/wordpress/2020/12/16/use-the-menu-files/ Wed, 16 Dec 2020 09:14:11 +0000 https://pdfbooklet.sourceforge.io/wordpress/?p=1
Read More]]> The file manager lets you open one or several files, and lets you modify the order of opened files:

You have two ways to use it :

  1. Select the files in the upper part and click “Open Selected File(s)”
  2. Select one or more files and click on the + button. The file(s) is (are) added to the list. You may select files from different directories. You may delete some file from the list with the x button, move up or down a particular file in the list by drag and drop (or with the ↑ and ↓ buttons if you prefer) or start a new list (clear the existing list) with the open button.

Once your list is OK, open it with “Open File(s)” in the list.

The output file will be created in the same directory as the source file (the first source file if you have more than one file opened), with the same name + -bklt.

You can change this default behavior in the Options tab. See details below in the description of this tab.

]]>