def TextTest(test_dir):

    """ Functional test for text, paragraph, and page
    splitting.

    """

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/TextTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="Testing Text")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    # Example for adding short and long text and whitespaces
    document.add_text("Testing")
    document.add_newline(4)
    document.add_text("Testing Again")
    document.add_newline()
    document.add_indent()
    document.add_text(
        "This should be enough text to test going over the edge of the \
        page, and having to wrap back around. Let's see if it works!")
    document.add_page()

    # Save existing font, define a new font, use it for a header
    normal_font = document.get_font()
    document.set_font('helvetica', style='B', size=24)
    header_font = document.get_font()
    document.add_newline(2)
    document.add_text("1.0 Testing a Header")

    # Change font back
    document.set_font(font=normal_font)
    document.add_newline(2)
    document.add_indent()
    document.add_text("And we're back to normal after the header.")
    document.add_newline(2)

    # Test decoration, and size changes
    document.set_font('helvetica', style='BUI', size=12)
    document.add_text("Testing Bold Underline Italic Style")
    document.add_newline(2)
    document.set_font("helvetica", style="BUI", size=24)
    document.add_text("Testing Bold Underline Italic Style Bigger")
    document.add_newline(2)
    document.set_font("helvetica", style="BUI", size=8)
    document.add_text("Testing Bold Underline Italic Style Smaller")

    # Test automatic page split
    document.set_font(font=normal_font)
    document.add_newline(5)
    document.add_text("What")
    document.add_newline(5)
    document.add_text("will")
    document.add_newline(5)
    document.add_text("happen")
    document.add_newline(5)

    # Create color Object, apply to fill color
    document.add_text("when")
    document.add_newline(5)
    lightblue = PDFColor(name='lightblue')
    document.set_text_color(lightblue)
    document.add_text("I")
    document.add_newline(5)
    document.add_text("go")
    document.add_newline(5)
    document.add_text("on")
    document.add_newline(5)
    document.add_text("to")
    document.add_newline(5)
    document.add_text("the")
    document.add_newline(5)
    document.add_text("next")
    document.add_newline(5)
    document.add_text("page?")
    document.add_newline()

    # Test Page splitting with paragraphs
    document.add_text(
        """Lorem Ipsum is simply dummy text of the printing and\
        typesetting industry. Lorem Ipsum has been the industry's\
        standard dummy text ever since the 1500s, when an unknown\
        printer took a galley of type and scrambled it to make a\
        type specimen book. It has survived not only five centuries,\
        but also the leap into electronic typesetting, remaining\
        essentially unchanged. It was popularised in the 1960s with\
        the release of Letraset sheets containing Lorem Ipsum passages,\
        and more recently with desktop publishing software like Aldus\
        PageMaker including versions of Lorem Ipsum.""")
    document.add_newline(2)
    document.double_space(0.5)
    document.add_text(
        """Lorem ipsum dolor sit amet, consectetur adipiscing elit.\
        Cras et erat dolor. Nullam id aliquam neque. Vivamus nec nibh\
        orci. Nam faucibus dignissim diam eget tempor. Aenean neque sem,\
        euismod sit amet tellus nec, elementum varius diam. Vestibulum\
        in ultricies enim. Fusce imperdiet tempus lacus facilisis\
        vestibulum. Vestibulum urna magna, dignissim vel venenatis in,\
        pulvinar ac orci. Etiam vitae tempor metus, eu tristique mauris.\
        Donec tincidunt purus et scelerisque sagittis. Proin semper\
        facilisis vehicula.""")
    document.add_text(
        """Pellentesque rhoncus vestibulum turpis ut varius. Nunc a rutrum\
        est. Etiam sollicitudin rhoncus nisl, quis scelerisque felis\
        dignissim vitae. Maecenas rutrum quam at risus mattis congue. Sed\
        hendrerit nulla ac nunc consectetur suscipit. Fusce elementum\
        interdum nibh, et fermentum lacus egestas non. Sed consectetur\
        mollis tortor, eu aliquam leo tristique sit amet. Etiam nec lectus\
        magna. Nam faucibus scelerisque velit nec cursus. Ut a dolor\
        accumsan, gravida nunc vitae, luctus quam. Vestibulum quis gravida\
        quam. Proin feugiat urna ut rutrum facilisis. Vivamus gravida iaculis\
        nibh at feugiat.""")

    # Close writer
    writer.close()
 def TrueTypeTest(test_dir):

    """ Functional test for text, paragraph, and page
    splitting.

    """

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/TrueTypeTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="Testing True Type Text")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    # Example for adding short and long text and whitespaces
    document.set_font('comic sans ms', size=16)
    document.add_text("Testing")
    document.add_newline(4)
    document.add_text("Testing Again")
    document.add_newline()
    document.add_indent()
    document.add_text(
        "This should be enough text to test going over the edge of the\
        page, and having to wrap back around. Let's see if it works!")
    document.add_page()

    # Save existing font, define a new font, use it for a header
    normal_font = document.get_font()
    document.set_font('arial', style='B', size=24)
    header_font = document.get_font()
    document.add_newline(2)
    document.add_text("1.0 Testing a Header")

    # Change font back
    document.set_font(font=normal_font)
    document.add_newline(2)
    document.add_indent()
    document.add_text("And we're back to normal after the header.")
    document.add_newline(2)

    # Test decoration, and size changes
    document.set_font('arial', style='BUI', size=12)
    document.add_text("Testing Bold Underline Italic Style")
    document.add_newline(2)
    document.set_font("arial", style="BUI", size=24)
    document.add_text("Testing Bold Underline Italic Style Bigger")
    document.add_newline(2)
    document.set_font("arial", style="BUI", size=8)
    document.add_text("Testing Bold Underline Italic Style Smaller")

    # Test automatic page split
    document.set_font(font=normal_font)
    document.add_newline(5)
    document.add_text("What")
    document.add_newline(5)
    document.add_text("will")
    document.add_newline(5)
    document.add_text("happen")
    document.add_newline(5)

    # Create color Object, apply to fill color
    document.add_text("when")
    document.add_newline(5)
    lightblue = PDFColor(name='lightblue')
    document.set_text_color(lightblue)
    document.add_text("I")
    document.add_newline(5)
    document.add_text("go")
    document.add_newline(5)
    document.add_text("on")
    document.add_newline(5)
    document.add_text("to")
    document.add_newline(5)
    document.add_text("the")
    document.add_newline(5)
    document.add_text("next")
    document.add_newline(5)
    document.add_text("page?")
    document.add_newline()

    # Test Page splitting with paragraphs
    document.add_text(
        """Lorem Ipsum is simply dummy text of the printing and\
        typesetting industry. Lorem Ipsum has been the industry's\
        standard dummy text ever since the 1500s, when an unknown\
        printer took a galley of type and scrambled it to make a\
        type specimen book. It has survived not only five centuries,\
        but also the leap into electronic typesetting, remaining\
        essentially unchanged. It was popularised in the 1960s with\
        the release of Letraset sheets containing Lorem Ipsum passages,\
        and more recently with desktop publishing software like Aldus\
        PageMaker including versions of Lorem Ipsum.""")
    document.add_newline(2)
    document.add_text(
        """Lorem ipsum dolor sit amet, consectetur adipiscing elit.\
        Cras et erat dolor. Nullam id aliquam neque. Vivamus nec nibh\
        orci. Nam faucibus dignissim diam eget tempor. Aenean neque sem,\
        euismod sit amet tellus nec, elementum varius diam. Vestibulum\
        in ultricies enim. Fusce imperdiet tempus lacus facilisis\
        vestibulum. Vestibulum urna magna, dignissim vel venenatis in,\
        pulvinar ac orci. Etiam vitae tempor metus, eu tristique mauris.\
        Donec tincidunt purus et scelerisque sagittis. Proin semper\
        facilisis vehicula.""")
    document.add_text(
        """Pellentesque rhoncus vestibulum turpis ut varius. Nunc a rutrum\
        est. Etiam sollicitudin rhoncus nisl, quis scelerisque felis\
        dignissim vitae. Maecenas rutrum quam at risus mattis congue. Sed\
        hendrerit nulla ac nunc consectetur suscipit. Fusce elementum\
        interdum nibh, et fermentum lacus egestas non. Sed consectetur\
        mollis tortor, eu aliquam leo tristique sit amet. Etiam nec lectus\
        magna. Nam faucibus scelerisque velit nec cursus. Ut a dolor\
        accumsan, gravida nunc vitae, luctus quam. Vestibulum quis gravida\
        quam. Proin feugiat urna ut rutrum facilisis. Vivamus gravida iaculis\
        nibh at feugiat.""")

    # Close writer
    writer.close() def ListTest(test_dir):

    """ Functional test for text, paragraph, and page
    splitting.

    """

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/ListTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="Testing Lists")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    # Make a header
    document.set_font(family='helvetica', style='B', size=24)
    document.add_text("This is my list!")
    document.add_newline(2)

    # Make a list
    document.set_font(family='helvetica', size=16)
    document.add_list("Testing1", "Testing2", "Testing3")
    document.add_newline(4)

    document.set_font(family='arial', size=18)
    document.start_block_indent()
    document.add_list("Arial didn't", "have native", "bullets", force=True)
    document.end_block_indent()

    document.add_newline(2)
    document.add_text("And this is my followup text")

    # Close writer
    writer.close()
 def UnderlineTest(test_dir):

    """ Functional test for text, paragraph, and page
    splitting.

    """

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/UnderlineTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="Underlining")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    # Check underlines at sizes
    document.set_font('helvetica', style='U', size=8)
    document.add_text("Testing size 8, normal")
    document.add_newline(2)

    document.set_font('helvetica', style='U', size=12)
    document.add_text("Testing size 12, normal")
    document.add_newline(2)

    document.set_font('helvetica', style='U', size=16)
    document.add_text("Testing size 16, normal")
    document.add_newline(2)

    document.set_font('helvetica', style='U', size=20)
    document.add_text("Testing size 20, normal")
    document.add_newline(2)

    document.set_font('helvetica', style='U', size=24)
    document.add_text("Testing size 24, normal")
    document.add_newline(2)

    document.set_font('helvetica', style='U', size=28)
    document.add_text("Testing size 28, normal")
    document.add_newline(2)

    document.set_font('helvetica', style='U', size=32)
    document.add_text("Testing size 32, normal")
    document.add_newline(2)

    document.set_font('helvetica', style='U', size=36)
    document.add_text("Testing size 36, normal")
    document.add_newline(2)

    document.add_page()

    # Check underlines with Bold
    document.set_font('helvetica', style='BU', size=8)
    document.add_text("Testing size 8, bold")
    document.add_newline(2)

    document.set_font('helvetica', style='BU', size=12)
    document.add_text("Testing size 12, bold")
    document.add_newline(2)

    document.set_font('helvetica', style='BU', size=16)
    document.add_text("Testing size 16, bold")
    document.add_newline(2)

    document.set_font('helvetica', style='BU', size=20)
    document.add_text("Testing size 20, bold")
    document.add_newline(2)

    document.set_font('helvetica', style='BU', size=24)
    document.add_text("Testing size 24, bold")
    document.add_newline(2)

    document.set_font('helvetica', style='BU', size=28)
    document.add_text("Testing size 28, bold")
    document.add_newline(2)

    document.set_font('helvetica', style='BU', size=32)
    document.add_text("Testing size 32, bold")
    document.add_newline(2)

    document.set_font('helvetica', style='BU', size=36)
    document.add_text("Testing size 36, bold")
    document.add_newline(2)

    # Close writer
    writer.close() def LandscapeTest(test_dir):

    """ Test landscape orientation & background images.

    """

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/Landscape.pdf"), orientation="P")
    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="Testing Landscape")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    # Example for adding short and long text and whitespaces
    document.add_text("Testing")
    document.add_newline(4)
    document.add_text("Testing Again")
    document.add_newline()
    document.add_page()
    document.change_page_orientation()
    document.add_text(
        """Lorem ipsum dolor sit amet, consectetur adipiscing elit.\
        Cras et erat dolor. Nullam id aliquam neque. Vivamus nec nibh\
        orci. Nam faucibus dignissim diam eget tempor. Aenean neque sem,\
        euismod sit amet tellus nec, elementum varius diam. Vestibulum\
        in ultricies enim. Fusce imperdiet tempus lacus facilisis\
        vestibulum. Vestibulum urna magna, dignissim vel venenatis in,\
        pulvinar ac orci. Etiam vitae tempor metus, eu tristique mauris.\
        Donec tincidunt purus et scelerisque sagittis. Proin semper\
        facilisis vehicula.""")
    document.add_text(
        """Pellentesque rhoncus vestibulum turpis ut varius. Nunc a rutrum\
        est. Etiam sollicitudin rhoncus nisl, quis scelerisque felis\
        dignissim vitae. Maecenas rutrum quam at risus mattis congue. Sed\
        hendrerit nulla ac nunc consectetur suscipit. Fusce elementum\
        interdum nibh, et fermentum lacus egestas non. Sed consectetur\
        mollis tortor, eu aliquam leo tristique sit amet. Etiam nec lectus\
        magna. Nam faucibus scelerisque velit nec cursus. Ut a dolor\
        accumsan, gravida nunc vitae, luctus quam. Vestibulum quis gravida\
        quam. Proin feugiat urna ut rutrum facilisis. Vivamus gravida iaculis\
        nibh at feugiat.""")
    # Close writer
    writer.close() def LinesTest(test_dir):

    """ Functional tests for creating lines.

    """
    # Create PDFLite object
    writer = PDFLite(os.path.join(test_dir, "tests/LinesTest.pdf"))

    # Set compression defaults to False
    writer.set_compression(False)

    # Set document metadata
    writer.set_information(title="Testing Lines")  # set optional information

    # Get document object
    document = writer.get_document()

    # Test add line by (x, y, x, y)
    document.add_line(20, 40, 300, 80)

    # Add Horizontal rule under text
    document.add_text("Testing")
    document.add_newline(1)
    document.draw_horizontal_line()

    # Create color Object, apply to fill color
    lightblue = PDFColor(name='lightblue')

    # Draw styled rectangle.
    document.set_fill_color(lightblue)
    document.draw_rectangle(150, 500, 300, 600, style='B')

    # Draw Dashed Line
    document.add_line(400, 250, 300, 500, stroke="dots")

    # Close Document
    writer.close()
 def TableTest(test_dir):

    """ Functional test for text, paragraph, and page
    splitting.

    """

    data = [["Heading1", "Heading2", "Heading3"],
            ["Cell a2", "Cell b2", "Cell c2"],
            ["Cell a3", "Cell b3", "Cell c3"]]

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/TableTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="Testing Table")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    document.set_cursor(100, 100)

    document.set_font(family='arial', style='UB', size=12)
    underline = document.get_font()

    document.set_font(family='arial', size=12)
    default_font = document.get_font()
    # Example for adding short and long text and whitespaces
    mytable = document.add_table(3, 3)
    green = PDFColor(name='green')

    default = document.add_cell_format({'font': default_font, 'align': 'left', 'border': (0, 1)})
    justleft = document.add_cell_format({'left': (0, 1)})
    header_format = document.add_cell_format({'font': underline, 'align': 'right', 'border': (0, 1)})
    green_format = document.add_cell_format({'font': default_font, 'border': (0, 1), 'fill_color': green})

    #mytable.set_column_width(1, 200)
    #mytable.set_row_height(2, 200)

    mytable.write_row(0, 0, data[0], header_format)
    mytable.write_row(1, 0, data[1], justleft)
    mytable.write_row(2, 0, data[2], green_format)

    document.draw_table(mytable)
    document.add_newline(4)
    document.add_text("Testing followup text")

    # Close writer
    writer.close()
 def PNGTest(test_dir):

    """ Functional test for adding images.

    """
    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/PNGTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="PNG Testing")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    # Example for adding short and long text and whitespaces
    document.add_text("This should be before the image.")
    document.add_newline(1)

    mylogo = document.add_image(os.path.join(test_dir, "example.png"))
    document.draw_image(mylogo)
    document.add_newline(1)

    document.add_text("This should be after")

    document.add_newline(1)
    document.draw_image(mylogo)

    document.add_text("There it is without a newline")

    document.add_newline(3)
    apple = document.add_image(os.path.join(test_dir, 'apple_logo.png'))
    document.draw_image(apple)

    document.add_page()

    document.set_background_image(os.path.join(test_dir, "example.png"))

    document.add_text("This text, ")
    document.add_text("And this text")
    document.add_newline(2)
    document.add_text("Should be on the background.")

    # Close writer
    writer.close() def JPGTest(test_dir):

    """ Functional test for adding images.

    """
    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/JPGTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="JPG Testing")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    # Example for adding short and long text and whitespaces
    document.add_text("This should be before the image.")
    document.add_newline(1)

    mylogo = document.add_image(os.path.join(test_dir, "example.jpg"))
    document.draw_image(mylogo)
    document.add_newline(1)

    document.add_text("This should be after")

    document.add_newline(1)
    document.draw_image(mylogo)

    document.add_text("There it is without a newline")

    # Close writer
    writer.close() def PageNumberTest(test_dir):

    """ Functional test for text, paragraph, and page
    splitting.

    """

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/PageNumberTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="Testing Text")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    # Example for adding short and long text and whitespaces
    document.add_text("Testing")
    document.add_newline(4)
    document.add_text("Testing Again")
    document.add_newline()
    document.add_indent()
    document.add_text(
        "This should be enough text to test going over the edge of the \
        page, and having to wrap back around. Let's see if it works!")
    document.add_page()

    # Save existing font, define a new font, use it for a header
    normal_font = document.get_font()
    document.set_font('helvetica', style='B', size=24)
    header_font = document.get_font()
    document.add_newline(2)
    document.add_text("1.0 Testing a Header")

    # Change font back
    document.set_font(font=normal_font)
    document.add_newline(2)
    document.add_indent()
    document.add_text("And we're back to normal after the header.")
    document.add_newline(2)

    # Test decoration, and size changes
    document.set_font('helvetica', style='BUI', size=12)
    document.add_text("Testing Bold Underline Italic Style")
    document.add_newline(2)
    document.set_font("helvetica", style="BUI", size=24)
    document.add_text("Testing Bold Underline Italic Style Bigger")
    document.add_newline(2)
    document.set_font("helvetica", style="BUI", size=8)
    document.add_text("Testing Bold Underline Italic Style Smaller")

    # Test automatic page split
    document.set_font(font=normal_font)
    document.add_newline(5)
    document.add_text("What")
    document.add_newline(5)
    document.add_text("will")
    document.add_newline(5)
    document.add_text("happen")
    document.add_newline(5)

    # Create color Object, apply to fill color
    document.add_text("when")
    document.add_newline(5)
    lightblue = PDFColor(name='lightblue')
    document.set_text_color(lightblue)
    document.add_text("I")
    document.add_newline(5)
    document.add_text("go")
    document.add_newline(5)
    document.add_text("on")
    document.add_newline(5)
    document.add_text("to")
    document.add_newline(5)
    document.add_text("the")
    document.add_newline(5)
    document.add_text("next")
    document.add_newline(5)
    document.add_text("page?")
    document.add_newline()

    # Test Page splitting with paragraphs
    document.add_text(
        """Lorem Ipsum is simply dummy text of the printing and\
        typesetting industry. Lorem Ipsum has been the industry's\
        standard dummy text ever since the 1500s, when an unknown\
        printer took a galley of type and scrambled it to make a\
        type specimen book. It has survived not only five centuries,\
        but also the leap into electronic typesetting, remaining\
        essentially unchanged. It was popularised in the 1960s with\
        the release of Letraset sheets containing Lorem Ipsum passages,\
        and more recently with desktop publishing software like Aldus\
        PageMaker including versions of Lorem Ipsum.""")
    document.add_newline(2)
    document.add_text(
        """Lorem ipsum dolor sit amet, consectetur adipiscing elit.\
        Cras et erat dolor. Nullam id aliquam neque. Vivamus nec nibh\
        orci. Nam faucibus dignissim diam eget tempor. Aenean neque sem,\
        euismod sit amet tellus nec, elementum varius diam. Vestibulum\
        in ultricies enim. Fusce imperdiet tempus lacus facilisis\
        vestibulum. Vestibulum urna magna, dignissim vel venenatis in,\
        pulvinar ac orci. Etiam vitae tempor metus, eu tristique mauris.\
        Donec tincidunt purus et scelerisque sagittis. Proin semper\
        facilisis vehicula.""")
    document.add_text(
        """Pellentesque rhoncus vestibulum turpis ut varius. Nunc a rutrum\
        est. Etiam sollicitudin rhoncus nisl, quis scelerisque felis\
        dignissim vitae. Maecenas rutrum quam at risus mattis congue. Sed\
        hendrerit nulla ac nunc consectetur suscipit. Fusce elementum\
        interdum nibh, et fermentum lacus egestas non. Sed consectetur\
        mollis tortor, eu aliquam leo tristique sit amet. Etiam nec lectus\
        magna. Nam faucibus scelerisque velit nec cursus. Ut a dolor\
        accumsan, gravida nunc vitae, luctus quam. Vestibulum quis gravida\
        quam. Proin feugiat urna ut rutrum facilisis. Vivamus gravida iaculis\
        nibh at feugiat.""")

    document.add_page_numbers(font=normal_font, color=PDFColor(), text2=' of %s')
    # Close writer
    writer.close()
 def ImageSizeTest(test_dir):
    """ Functional test for adding images.

    """

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/ImageSizeTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="PNG Size Testing")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    # Example for adding short and long text and whitespaces
    document.add_text("This is the image")
    document.add_newline(1)

    mylogo = document.add_image(os.path.join(test_dir, "apple_logo.png"))
    document.draw_image(mylogo)
    document.add_newline(1)

    document.add_text("This is the image smaller")
    document.draw_image(mylogo, width=100)
    document.add_newline(1)

    document.add_page()
    document.add_text("This is the image larger")
    document.draw_image(mylogo, width=300)
    document.add_newline(3)

    # Close writer
    writer.close() def EllipseTest(test_dir):
    """
    Functional test for drawing eclipses
    """
    # Create PDFLite object
    writer = PDFLite(os.path.join(test_dir, "tests/EllipseTest.pdf"))

    # Set compression defaults to False
    writer.set_compression(False)

    # Set document metadata
    writer.set_information(title="Testing Lines")  # set optional information

    # Get document object
    document = writer.get_document()

    color = PDFColor(name='red')
    center = PDFCursor(100, 100)
    radius = PDFCursor(20, 30)
    
    circle = PDFEllipse(document.session, document.page, center, radius, color)
    circle._draw()
    
    center.x = 200
    center.y = 200
    circle = PDFEllipse(document.session, document.page, center, radius, color, style='F')
    circle._draw()
    
    center.x = 100
    center.y = 200
    radius.x = 40
    circle = PDFEllipse(document.session, document.page, center, radius, color, size=3)
    circle._draw()


    # Close Document
    writer.close() def CircleTest(test_dir):
    """
    Functional test for drawing eclipses
    """
    # Create PDFLite object
    writer = PDFLite(os.path.join(test_dir, "tests/CircleTest.pdf"))

    # Set compression defaults to False
    writer.set_compression(False)

    # Set document metadata
    writer.set_information(title="Testing Circles")  # set optional information

    # Get document object
    document = writer.get_document()
    black = PDFColor()

    red = PDFColor(name='red')
    center = PDFCursor(100, 100)

    document.draw_circle(center, 10, black, red, style='F')

    green = PDFColor(name='green')
    center = PDFCursor(300, 300)
    document.draw_circle(center, 20, black, green, style='B', stroke="dotted")

    center = PDFCursor(350, 400)
    document.draw_circle(center, 30, None, None, size=2)

    # Close Document
    writer.close() def TransformTest(test_dir):

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/Transform.pdf"), orientation="P")
    # If desired (in production code), set compression
    writer.set_compression(False)

    # Set general information metadata
    writer.set_information(title="Testing Transform")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()
    
    document.add_text("Transform test")
    
    document.add_newline(4)

    text = PDFText(document.session, document.page, None)
    text._text('transform')
    
    text.cursor.x_plus(20)
    text.text_rotate(90)
    text._text('transform')
    
    text = PDFText(document.session, document.page, None)
    text.cursor.x_plus(20)
    text.text_rotate(180)
    text._text('transform')
    
    text = PDFText(document.session, document.page, None)
    text.cursor.x_plus(20)
    text.text_rotate(-90)
    text._text('transform')
    
    document.add_newline(5)

    text = PDFText(document.session, document.page, None)
    text._text('transform  ')
    text.text_scale(2, 0.5)
    text._text('transform')

    document.add_newline(2)
    text = PDFText(document.session, document.page, None)
    text._text('transform  ')
    text.text_scale(0.5, 2)
    text._text('transform')

    document.add_newline(2)
    text = PDFText(document.session, document.page, None)
    text._text('transform  ')
    text.text_skew(30, 0)
    text._text('transform')

    document.add_newline(2)
    text = PDFText(document.session, document.page, None)
    text._text('transform  ')
    text.text_skew(0, 30)
    text._text('transform')

    # Close writer
    writer.close() def HtmlTest(test_dir):
    writer = PDFLite(os.path.join(test_dir, "tests/HTMLtest.pdf"))
    document = writer.get_document()

    document.add_text('Sample text')
    document.add_newline(2)


    red = PDFColor(name="red")
    blue = PDFColor(name='blue')
    green = PDFColor(name='green')

    normalfont = document.get_font()
    header1 = document.set_font('helvetica', style='B', size=22)
    coolfont = document.set_font('comic sans ms', style='', size=12)
    header2 = document.set_font('helvetica', style='I', size=18)
    document.set_font(font=normalfont)

    html_text = """
                  <html>
                  <head><title>Test Title</title>
                        <script>document.write("Hello World!")</script>
                  </head>
                  <h1>My Week</h1>
                  <p>Today, the day is <span class="red coolfont" data-bind="daytoday"></span>, and it is sunny here in
                        <span class="green" data-bind="location"></span>. Honestly, it's almost always sunny. It
                        can get rather boring.</p>
                  <br/>
                  <h2>Things I miss</h2>
                  <ol type='I' ">
                  <li>Fall Carnivals</li>
                  <li>Skiing <span class='blue' data-bind="skiing"></span></li>
                  <li>Museums</li>
                  <li><p>And a whole bunch of other things, that I'm not sure if I just liked it because I was a kid,
                  or because it was actually a lot of fun.</p></li>
                  <li>Testing Unordered List</li>
                  <li>
                    <ul>
                    <li>One</li>
                    <li>Two</li>
                    <li>Three</li>
                    <li>Testing Blockquote:
                        <blockquote>"Computers are useless, they can only give you answers"</blockquote></li>
                    <li>After the quote</li>
                    </ul>
                    </li>
                  <li>After the List</li>
                  </ol>
                  <p>Next week I will go to the <span class="blue coolfont" data-bind="destination"></span>.....
                  <a href="http://www.google.com">Visit Google.com!</a> I hope it's fun.
                  </p>
                  </html>
                """

    document.add_html(html_text,
                      context={"daytoday": " Thursday", "location": " California", "destination": " opera", "skiing": " at Stowe."},
                      formats={"h1": header1, "h2": header2, "red": red, "coolfont": coolfont, "p": normalfont,
                               'ul': normalfont, 'ol': normalfont, 'blue': blue, 'green': green}
                      )

    document.add_text("After HTML.")
    writer.close() def HtmlTest2(test_dir):
    writer = PDFLite(os.path.join(test_dir, "tests/HTMLtest2.pdf"))
    document = writer.get_document()

    document.add_text('Sample text')
    document.add_newline(2)

    red = PDFColor(name="red")
    blue = PDFColor(name='blue')
    green = PDFColor(name='green')

    normalfont = document.get_font()
    header1 = document.set_font('helvetica', style='B', size=22)
    coolfont = document.set_font('comic sans ms', style='', size=12)
    header2 = document.set_font('helvetica', style='I', size=18)

    with open(os.path.join(test_dir, "test.html")) as fp:
        html_text = fp.read()

    document.add_html(html_text,
                      context={"daytoday": " Thursday", "location": " California", "destination": " opera", "skiing": " at Stowe."},
                      formats={"h1": header1, "h2": header2, "red": red, "coolfont": coolfont, "p": normalfont,
                               'ul': normalfont, 'ol': normalfont, 'blue': blue, 'green': green}
                      )

    document.add_text("After HTML.")
    writer.close() def JustifyTest(test_dir):

    """ Functional test for text, paragraph, and page
    splitting.

    """

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/JustifyTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="Testing Text")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()

    # Example for adding short and long text and whitespaces
    document.add_text("Testing")
    document.add_newline(4)
    document.set_justification('right')
    document.add_text("Testing Right")
    document.add_text("Testing Right")
    document.add_newline(2)
    document.set_justification('center')
    document.add_text("In the middle")
    document.add_newline()
    document.add_text("Center")
    document.add_newline()
    document.add_text("""Lorem Ipsum is simply dummy text of the printing and\
        typesetting industry. Lorem Ipsum has been the industry's\
        standard dummy text ever since the 1500s, when an unknown\
        printer took a galley of type and scrambled it to make a\
        type specimen book. It has survived not only five centuries,\
        but also the leap into electronic typesetting, remaining\
        essentially unchanged. It was popularised in the 1960s with\
        the release of Letraset sheets containing Lorem Ipsum passages,\
        and more recently with desktop publishing software like Aldus\
        PageMaker including versions of Lorem Ipsum.""")

    document.set_justification('right')
    document.add_text("right")
    document.add_newline(2)
    document.add_text("""Lorem Ipsum is simply dummy text of the printing and\
        typesetting industry. Lorem Ipsum has been the industry's\
        standard dummy text ever since the 1500s, when an unknown\
        printer took a galley of type and scrambled it to make a\
        type specimen book. It has survived not only five centuries,\
        but also the leap into electronic typesetting, remaining\
        essentially unchanged. It was popularised in the 1960s with\
        the release of Letraset sheets containing Lorem Ipsum passages,\
        and more recently with desktop publishing software like Aldus\
        PageMaker including versions of Lorem Ipsum.""")

    # Close writer
    writer.close() def MarginTest(test_dir):

    """ Functional test for text, paragraph, and page
    splitting.

    """

    #Create PDFLITE object, initialize with path & filename.
    writer = PDFLite(os.path.join(test_dir, "tests/MarginTest.pdf"))

    # If desired (in production code), set compression
    # writer.setCompression(True)

    # Set general information metadata
    writer.set_information(title="Testing Margins")  # set optional information

    # Use get_document method to get the generated document object.
    document = writer.get_document()
    document.set_margins(20, 30, 20, 30)

    document.set_font("helvetica", size=20)
    # Add test text
    document.add_text("""|00 TTTT TTTTTT TTTTTT TTTTT TTTTT TTTTT TTTTT TTT|
                         |01.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |02.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |03.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |04.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |05.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |06.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |07.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |08.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |09.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |10.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |11.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |12.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |13.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |14.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |15.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |16.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |17.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |18.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |19.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |20.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |21.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |22.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |23.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |24.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |25.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |26.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |27.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |28.. .... .... .... .... .... .... .... .... ...... .... .... .... .... .... .... .... .... ... |\
                         |29.. .... .... .... ....
                      """)

    document.add_text(" Small words ")
    document.add_text(""" Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
                          been the industry's standard dummy text ever since the 1500s, when an unknown printer took a
                          galley of type and scrambled it to make a type specimen book. It has survived not only five
                          centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
                          It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum
                          passages, and more recently with desktop publishing software like Aldus PageMaker including
                          versions of Lorem Ipsum.""")

    writer.close() def ArcTest(test_dir):
    """
    Functional test for drawing eclipses
    """
    # Create PDFLite object
    writer = PDFLite(os.path.join(test_dir, "tests/ArcTest.pdf"))

    # Set compression defaults to False
    writer.set_compression(False)

    # Set document metadata
    writer.set_information(title="Testing Arcs")  # set optional information

    # Get document object
    document = writer.get_document()
    black = PDFColor()

    center = PDFCursor(300, 300)
    radius = 50
    document.draw_circle(center, radius, black)


    red = PDFColor(name='red')
    starting_angle = 15
    arc_angle = 135

    document.draw_arc(center, radius, starting_angle, arc_angle, inverted=False, border_color=red, style='F')


    center = PDFCursor(300, 400)

    document.draw_arc(center, radius, starting_angle, arc_angle, inverted=True, border_color=red)
    # Close Document
    writer.close() def LineGraphTest(test_dir):
    """
    Functional test for drawing eclipses
    """
    # Create PDFLite object
    writer = PDFLite(os.path.join(test_dir, "tests/LineGraph.pdf"))

    # Set compression defaults to False
    writer.set_compression(False)

    # Set document metadata
    writer.set_information(title="Testing Line Graphs")  # set optional information

    # Get document object
    document = writer.get_document()
    cursor = PDFCursor(100, 50)
    data = [{"series1": [(0, 100), (3600, 425), (7200, 550), (10800, 425), (14400, 500), (18000, 825)]},
           {"series2": [(0, 50), (3600, 240), (7200, 675), (10800, 775), (14400, 980)]}]

    document.add_line_graph(data, cursor, 400, 200, "Hits over Time", (0, 18000), (0, 1100), (3600, 100), ("time (s)", "count"), "Auto", background=BasicBackground, legend="right")

    cursor = PDFCursor(100, 400)
    document.add_line_graph(data, cursor, 400, 300, "Hits over Time", None, None, (3600, 50), ("time (s)", "count"), "Auto", background=BasicBackground, dots=1)

    document.add_page()
    cursor = PDFCursor(100, 50)
    data = [{"series1": [(1, 100), (2, 200), (3, 150), (4, 125), (5, 170), (6, 190), (7, 210)]}]

    document.add_line_graph(data, cursor, 200, 150, axis=False)

    # Close Document
    writer.close() def XYScatterPlotTest(test_dir):
    """
    Functional test for drawing eclipses
    """
    # Create PDFLite object
    writer = PDFLite(os.path.join(test_dir, "tests/XYScatterPlot.pdf"))

    # Set compression defaults to False
    writer.set_compression(False)

    # Set document metadata
    writer.set_information(title="Testing XY Scatter Plots")  # set optional information

    # Get document object
    document = writer.get_document()
    cursor = PDFCursor(100, 50)
    data = [{"series1": [(14.2, 215), (16.4, 325), (11.9, 185), (15.2, 332), (18.5, 406), (22.1, 522), (19.4, 412), (25.1, 614), (23.4, 544), (18.1, 421), (22.6, 445), (17.2, 408)]}]

    document.add_xy_scatter(data, cursor, 400, 200, "Ice Cream Sales vs Temperature", (10, 26), (180, 660), (1, 50), ("temperature", "sales"), "Auto", background=BasicBackground, dots=1, legend="right")

    cursor = PDFCursor(100, 400)
    document.add_xy_scatter(data, cursor, 400, 200, "Ice Cream Sales vs Temperature", None, None, None, ("temperature", "sales"), "Auto", background=BasicBackground, dots=1, linear_regression=True, linear_regression_equation=True)

    # Close Document
    writer.close() def PieChartTest(test_dir):
    """
    Functional test for drawing eclipses
    """
    # Create PDFLite object
    writer = PDFLite(os.path.join(test_dir, "tests/PieChart.pdf"))

    # Set compression defaults to False
    writer.set_compression(False)

    # Set document metadata
    writer.set_information(title="Testing Pie Charts")  # set optional information

    # Get document object
    document = writer.get_document()
    cursor = PDFCursor(100, 50)
    data = [("English", 565004126), ("Chinese", 509965013), ("Spanish", 164968742),
            ("Arabic", 65365400), ("French", 59779525), ("Russian", 59700000),
            ("Japanese", 99182000), ("Portuguese", 82586600), ("German", 75422674),
            ("Korean", 39440000)]

    document.add_pie_chart(data, cursor, 400, 300, title="Languages Spoken on the Internet", legend="right")

    cursor = PDFCursor(100, 400)
    document.add_pie_chart(data, cursor, 400, 300, title="Languages Spoken on the Internet", labels=True)

    # Close Document
    writer.close() def BarChartTest(test_dir):
    """
    Functional test for drawing eclipses
    """
    # Create PDFLite object
    writer = PDFLite(os.path.join(test_dir, "tests/BarChart.pdf"))

    # Set compression defaults to False
    writer.set_compression(True)

    # Set document metadata
    writer.set_information(title="Testing Bar Chart")  # set optional information

    # Get document object
    document = writer.get_document()

    cursor = PDFCursor(100, 50)
    data = [("Sunday", 11.5), ("Monday", 13.9), ("Tuesday", 15.1), ("Wednesday", 15.2), ("Thursday", 16.3),
            ("Friday", 18.0), ("Saturday", 12.1)]

    document.add_simple_bar_chart(data, cursor, 400, 300, "Blog Re-tweets By Day of the Week", axis_titles=("day", "percent chance of re-tweet"), y_axis_limits=(11, 19), y_axis_frequency=1, bar_border_colors=PDFColor(0, 0, 0), bar_fill_colors=PDFColor(183, 143, 207))

    cursor = PDFCursor(100, 400)
    document.add_simple_bar_chart(data, cursor, 400, 300, "Blog Re-tweets By Day of the Week", axis_titles=("day", "percent chance of re-tweet"), y_axis_limits=(11, 19), y_axis_frequency=1)



    # Close Document
    writer.close() def MultiBarChartTest(test_dir):
    """
    Functional test for drawing eclipses
    """
    # Create PDFLite object
    writer = PDFLite(os.path.join(test_dir, "tests/MultiBarChart.pdf"))

    # Set compression defaults to False
    writer.set_compression(False)

    # Set document metadata
    writer.set_information(title="Testing Multi Bar Chart")  # set optional information

    # Get document object
    document = writer.get_document()

    cursor = PDFCursor(100, 50)
    data = [{"Susan Smith": [("S", 47.5), ("M", 46.1), ("T", 48.3), ("W", 44.2), ("T", 46.7), ("F", 47.6), ("S", 46.3)]},
            {"Jane Doe": [("S", 38.2), ("M", 38.9), ("T", 39.2), ("W", 38.6), ("T", 40.1), ("F", 41.6), ("S", 42.2)]}
           ]

    document.add_multi_bar_chart(data, cursor, 400, 300, "Candidate Polls", axis_titles=("day", "percent vote"), y_axis_limits=(35, 50), y_axis_frequency=2)

    cursor = PDFCursor(100, 400)
    document.add_multi_bar_chart(data, cursor, 400, 300, "Candidate Polls", ("day", "percent of votes"), y_axis_limits=(35, 50), y_axis_frequency=2, legend="right")

    # Close Document
    writer.close() def GraphBackgroundTest(test_dir):
    """
    Functional test for drawing eclipses
    """
    # Create PDFLite object
    writer = PDFLite(os.path.join(test_dir, "tests/GraphBackgrounds.pdf"))

    # Set compression defaults to False
    writer.set_compression(False)

    # Set document metadata
    writer.set_information(title="Testing Graph Backgrounds")  # set optional information

    # Get document object
    background = PDFGraphBackground("B", 2, PDFColor(name="plum"), PDFColor(name="cornflowerblue"), 0.11, "dotted")


    document = writer.get_document()
    cursor = PDFCursor(100, 50)
    data = [{"series1": [(0, 100), (3600, 425), (7200, 550), (10800, 425), (14400, 500), (18000, 825)]},
           {"series2": [(0, 50), (3600, 240), (7200, 675), (10800, 775), (14400, 980)]}]

    document.add_line_graph(data, cursor, 400, 200, "Hits over Time", (0, 18000), (0, 1100), (3600, 100), ("time (s)", "count"), "Auto", background=background, legend="right")

    cursor = PDFCursor(100, 400)
    data = [{"series1": [(14.2, 215), (16.4, 325), (11.9, 185), (15.2, 332), (18.5, 406), (22.1, 522), (19.4, 412), (25.1, 614), (23.4, 544), (18.1, 421), (22.6, 445), (17.2, 408)]}]

    document.add_xy_scatter(data, cursor, 400, 200, "Ice Cream Sales vs Temperature", (10, 26), (180, 660), (1, 50), ("temperature", "sales"), "Auto", background=background, dots=1, legend="right")

    document.add_page()
    cursor = PDFCursor(100, 50)
    data = [{"Susan Smith": [("S", 47.5), ("M", 46.1), ("T", 48.3), ("W", 44.2), ("T", 46.7), ("F", 47.6), ("S", 46.3)]},
            {"Jane Doe": [("S", 38.2), ("M", 38.9), ("T", 39.2), ("W", 38.6), ("T", 40.1), ("F", 41.6), ("S", 42.2)]}
           ]

    document.add_multi_bar_chart(data, cursor, 400, 300, "Candidate Polls", axis_titles=("day", "percent vote"), y_axis_limits=(35, 50), y_axis_frequency=2, background=background)


    # Close Document
    writer.close()
import os
from bin.texttest import TextTest
from bin.truetypetest import TrueTypeTest
from bin.listtest import ListTest
from bin.underlinetest import UnderlineTest
from bin.landscapetest import LandscapeTest
from bin.linetest import LinesTest
from bin.tabletest import TableTest
from bin.pngtest import PNGTest
from bin.jpgtest import JPGTest
from bin.pagenumbertest import PageNumberTest
from bin.pngsizetest import ImageSizeTest
from bin.ellipsetest import EllipseTest
from bin.circletest import CircleTest
from bin.transformtest import TransformTest
from bin.htmltest import HtmlTest
from bin.htmltest2 import HtmlTest2
from bin.justifytest import JustifyTest
from bin.pdfmargintest import MarginTest
from bin.arctest import ArcTest
from bin.linegraphtest import LineGraphTest
from bin.xyscatterplot import XYScatterPlotTest
from bin.piecharttest import PieChartTest
from bin.barcharttest import BarChartTest
from bin.multibartest import MultiBarChartTest
from bin.graphbackgrounds import GraphBackgroundTest


TEST_DIR = os.path.abspath('bin')

def main():
    print ("Running TextTest")
    TextTest(TEST_DIR)
    print ("Running TrueTypeTest")
    TrueTypeTest(TEST_DIR)
    print ("Running List Test")
    ListTest(TEST_DIR)
    print ("Running Margin Test")
    MarginTest(TEST_DIR)
    print ("Running Underline Test")
    UnderlineTest(TEST_DIR)
    print ("Running LandscapeTest")
    LandscapeTest(TEST_DIR)
    print ("Running LinesTest")
    LinesTest(TEST_DIR)
    print ("Running TableTest")
    TableTest(TEST_DIR)
    print ("Running PNGTest")
    PNGTest(TEST_DIR)
    print ("Running JPGTest")
    JPGTest(TEST_DIR)
    print ("Running PageNumberTest")
    PageNumberTest(TEST_DIR)
    print ("Running PNGSizeTest")
    ImageSizeTest(TEST_DIR)
    print ("Running EllipseTest")
    EllipseTest(TEST_DIR)
    print ("Running CircleTest")
    CircleTest(TEST_DIR)
    print ("Running Arctest")
    ArcTest(TEST_DIR)
    print ("Running TransformTest")
    TransformTest(TEST_DIR)
    print ("Running HTMLTest")
    HtmlTest(TEST_DIR)
    print ("Running HTMLTest2")
    HtmlTest2(TEST_DIR)
    print ("Running Justify Test")
    JustifyTest(TEST_DIR)
    print ("Running LineGraph Test")
    LineGraphTest(TEST_DIR)
    print ("Running XYScatter Test")
    XYScatterPlotTest(TEST_DIR)
    print ("Running PieChart Test")
    PieChartTest(TEST_DIR)
    print ("Running BarChart Test")
    BarChartTest(TEST_DIR)
    print ("Running MultiBarChart Test")

    MultiBarChartTest(TEST_DIR)