def __init__(self, filepath, orientation="P", layout="letter", font_list=None, font_dir=None): if font_dir is not None: FontLoader.load_from_dir(font_dir) elif font_list is not None: FontLoader.load_from_list(font_list) else: FontLoader.load_fonts() self.filepath = filepath self.destination = None if hasattr(self.filepath, 'write'): self.destination = self.filepath elif self.filepath == 'string': self.destination = 'string' # Create session and document objects self.session = _Session(self) self.document = PDFDocument(self.session, orientation, layout) # Full width display mode default self.set_display_mode() # Set default PDF version number self.pdf_version = '1.7' # Initialize PDF information self.set_information() self.set_compression()
def __init__(self, filepath): self.filepath = filepath self.SS = _Session(self) self.document = PDFDocument(self.SS) # Full width display mode default self.setDisplayMode() # Set default PDF version number self.pdf_version = '1.3' #Initialize PDF information self.setInformation() self.setCompression()