Example #1
0
 def test_code39(self, tmp_path):
     pdf = FPDF()
     pdf.add_page()
     pdf.code39("fpdf2", x=50, y=50, w=4, h=20)
     pdf.set_font("courier", "B", size=36)
     pdf.text(x=80, y=80, txt="fpdf2")
     assert_pdf_equal(pdf, HERE / "barcodes_code39.pdf", tmp_path)
Example #2
0
 def test_code39(self):
     pdf = FPDF()
     pdf.add_page()
     pdf.code39("fpdf2", x=50, y=50, w=4, h=20)
     pdf.set_font("courier", "B", size=36)
     pdf.text(x=80, y=80, txt="fpdf2")
     assert_pdf_equal(self, pdf, "test_code39.pdf")
Example #3
0
def dotest(outputname, nostamp):
    # Portrait, millimeter units, A4 page size
    pdf = FPDF("P", "mm", "A4")
    if nostamp:
        pdf._putinfo = lambda: common.test_putinfo(pdf)
    # Set font: Times, normal, size 10
    pdf.add_page()
    if not nostamp:
        # do not show picture in batch
        url = "http://upload.wikimedia.org/wikipedia/commons/thumb/0/0b/Code_3_of_9.svg/262px-Code_3_of_9.svg.png"
        pdf.image(url, 10, 10)

    pdf.code39("*wikipedia*", 12.75, 7, 1.49)

    pdf.output(outputname, 'F')
Example #4
0
def dotest(outputname, nostamp):
    # Portrait, millimeter units, A4 page size     
    pdf = FPDF("P", "mm", "A4")
    if nostamp:
        pdf._putinfo = lambda: common.test_putinfo(pdf)
    # Set font: Times, normal, size 10
    pdf.add_page()
    if not nostamp:
        # do not show picture in batch
        url = "http://upload.wikimedia.org/wikipedia/commons/thumb/0/0b/Code_3_of_9.svg/262px-Code_3_of_9.svg.png"
        pdf.image(url, 10, 10)

    pdf.code39("*wikipedia*", 12.75, 7, 1.49)

    pdf.output(outputname, 'F')