Module pdfimposer :: Class FileConverter

Class FileConverter

source code

AbstractConverter --+    
                    |    
      StreamConverter --+
                        |
                       FileConverter

This class performs conversions on true files.
Instance Methods
 
__init__(self, infile_name, outfile_name=None, layout='2x1', format='A4', flip=TwoSidedFlip.SHORT_EDGE, copy_pages=False, overwrite_outfile_callback=None)
Create a FileConverter.
source code
 
__del__(self) source code
 
get_infile_name(self)
Get the name of the input PDF file.
source code
 
get_outfile_name(self)
Get the name of the output PDF file.
source code
 
bookletize(self)
Convert a linear document to a booklet. (Inherited from pdfimposer.StreamConverter)
source code
 
get_copy_pages(self)
Get wether the same group of input pages will be copied to fill the corresponding output page or not. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_increasing_factor(self)
Calculate the increasing factor. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_input_format(self)
Return the format of the input paper (Inherited from pdfimposer.AbstractConverter)
source code
 
get_input_height(self)
Return the page height of the input document. (Inherited from pdfimposer.StreamConverter)
source code
 
get_input_orientation(self)
Return the page orientation of the input document. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_input_size(self)
Return the page size of the input document. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_input_width(self)
Return the page width of the input document. (Inherited from pdfimposer.StreamConverter)
source code
 
get_layout(self)
Return the layout of input pages on one output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_output_format(self)
Return the format of the output paper. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_output_height(self)
Get the height of the output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_output_width(self)
Get the width of the output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_page_count(self)
Return the number of pages of the input document. (Inherited from pdfimposer.StreamConverter)
source code
 
get_pages_in_height(self)
Get the number of input pages to put in the height on one output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_pages_in_sheet(self)
Calculate the number of input page that will be put on one output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_pages_in_width(self)
Get the number of input pages to put in the width on one output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_progress_callback(self)
Get the progress callback function. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_reduction_factor(self)
Calculate the reduction factor. (Inherited from pdfimposer.AbstractConverter)
source code
 
get_two_sided_flip(self)
Get the edge which the paper will be flipped on when printed. (Inherited from pdfimposer.AbstractConverter)
source code
 
linearize(self, booklet=True)
Convert a booklet to a linear document. (Inherited from pdfimposer.StreamConverter)
source code
 
reduce(self)
Put multiple input pages on one output page. (Inherited from pdfimposer.StreamConverter)
source code
 
set_copy_pages(self, copy_pages)
Set wether the same group of input pages shoud be copied to fill the corresponding output page or not. (Inherited from pdfimposer.AbstractConverter)
source code
 
set_layout(self, layout)
Set the layout of input pages on one output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
set_output_format(self, format)
Set the format of the output paper. (Inherited from pdfimposer.AbstractConverter)
source code
 
set_output_height(self, height)
Set the height of the output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
set_output_width(self, width)
Set the width of the output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
set_pages_in_height(self, num)
Set the number of input pages to put in the height on one output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
set_pages_in_width(self, num)
Set the number of input pages to put in the width on one output page. (Inherited from pdfimposer.AbstractConverter)
source code
 
set_progress_callback(self, progress_callback)
Register a progress callback function. (Inherited from pdfimposer.AbstractConverter)
source code
 
set_two_sided_flip(self, flip)
Set the edge which the paper will be flipped on when printed. Defaults to TwoSidedFlip.SHORT_EDGE, where all the output pages are the right way up. If your printer can only flip over the long edge, set this to TwoSidedFlip.LONG_EDGE. The imposer will rotate all even output pages 180° to compensate. (Inherited from pdfimposer.AbstractConverter)
source code
Class Variables
  page_formats = {"A3":(841, 1190), "A3":(842, 1192), "A4":(595,... (Inherited from pdfimposer.AbstractConverter)
Method Details

__init__(self, infile_name, outfile_name=None, layout='2x1', format='A4', flip=TwoSidedFlip.SHORT_EDGE, copy_pages=False, overwrite_outfile_callback=None)
(Constructor)

source code 
Create a FileConverter.
Parameters:
  • infile_name - The name to the input PDF file.
  • outfile_name - The name of the file where the output PDF should de written. If ommited, defaults to the name of the input PDF postponded by '-conv'.
  • layout - The layout of input pages on one output page (see set_layout).
  • format - The format of the output paper (see set_output_format).
  • copy_pages - Wether the same group of input pages shoud be copied to fill the corresponding output page or not (see set_copy_pages).
  • overwrite_outfile_callback - A callback function which is called if outfile_name already exists when trying to open it. Its signature must be : take a string for the outfile_name as an argument;

    return False not to overwrite the file. If ommited, existing file would be overwritten without confirmation.

Overrides: AbstractConverter.__init__

get_infile_name(self)

source code 
Get the name of the input PDF file.
Returns:
The name of the input PDF file.

get_outfile_name(self)

source code 
Get the name of the output PDF file.
Returns:
The name of the output PDF file.