def __init__(self, sub_type, additional_entrys=None, stream_filter_name="FlateDecode"): super(IndirectObject_Stream_XObject, self).__init__([ pdfex.Entry_Constant("Type", pdfex.Name("XObject")), pdfex.Entry_Constant("Subtype", pdfex.Name(sub_type)) ] + cact.default_list(additional_entrys), stream_filter_name) self.name = XOBJECT_NAME_GENERATOR.generate()
def __init__(self): super(IndirectObject_Resources, self).__init__([ pdfex.Entry_Constant("ProcSet", [ pdfex.Name("PDF"), pdfex.Name("Text"), pdfex.Name("ImageB"), pdfex.Name("ImageC"), pdfex.Name("ImageI") ]), pdfex.Entry_Function("XObject", lambda: self.get_xobject_entrys()) ])
def __init__(self, stream_filter_name="FlateDecode"): super(IndirectObject_Stream_XObject_SoftMask, self).__init__("Image", [ pdfex.Entry_Function("Width", lambda: self.get_width()), pdfex.Entry_Function("Height", lambda: self.get_height()), pdfex.Entry_Constant("ColorSpace", pdfex.Name("DeviceGray")), pdfex.Entry_Function("BitsPerComponent", lambda: self.get_bits_per_component()) ], stream_filter_name)
def __init__(self, pages=None, parent=None): super(IndirectObject_PageTree, self).__init__([ pdfex.Entry_Constant("Type", pdfex.Name("Pages")), pdfex.Entry_Value("pages", "Kids", []), pdfex.Entry_Value("parent", "Parent", parent), pdfex.Entry_Function("Count", lambda: len(self.pages)) ]) if pages: self.add_pages(pages)
def __init__(self, data, width, height, color_space=pdfex.Name("DeviceRGB"), bits_per_component=8, soft_mask=None, dpi=72.0, stream_filter_name="FlateDecode"): super(IndirectObject_Stream_XObject_Image_Manual, self).__init__(stream_filter_name) self.data = data self.width = width self.height = height self.color_space = color_space self.bits_per_component = bits_per_component self.soft_mask = soft_mask self.dpi = dpi
def render_content_value(self, content_renderer): content_renderer.append_value(pdfex.Name(self.name))
def render_pdf_value(self, pdf_renderer): pdf_renderer.append_value( [self.page, pdfex.Name(self.destination_type)] + self.get_destination_arguments())
def __init__(self, page_tree=None, open_action=None): super(IndirectObject_DocumentCatalog, self).__init__([ pdfex.Entry_Constant("Type", pdfex.Name("Catalog")), pdfex.Entry_Value("page_tree", "Pages", page_tree), pdfex.Entry_Value("open_action", "OpenAction", open_action) ])
def append_pair(self, key, value): self.start_line() self.append_value(pdfex.Name(key)) self.append_value(value) self.end_line()