示例#1
0
def test_normal_parse():
    pdf = PDF('../samples/normal.pdf')
    assert pdf.parse()
示例#2
0
def test_damaged_font_kor_eng_7():
    pdf = PDF('../samples/damaged_font.pdf')
    pdf.parse_content()
    assert pdf.content
示例#3
0
def test_damaged_check():
    pdf = PDF('../samples/damaged.pdf')
    assert not pdf.check()
示例#4
0
def test_damaged_kor_4_content():
    pdf = PDF('../samples/damaged_kor_hwp.pdf')  # PDF 1.4
    pdf.parse_content()
    assert pdf.content
示例#5
0
def test_damaged_kor_3_content():
    pdf = PDF('../samples/damaged_kor_1_3.pdf')  # PDF 1.3
    pdf.parse_content()
    assert pdf.content
示例#6
0
def test_kor_eng_7_content():
    pdf = PDF('../samples/kor_eng_word.pdf')
    pdf.parse_content()
    assert pdf.content
示例#7
0
def test_damaged_content():
    pdf = PDF('../samples/damaged.pdf')
    pdf.parse_content()
    assert pdf.content
示例#8
0
def test_print_metadata():
    pdf = PDF('../samples/normal.pdf')
    pdf.parse_metadata()
示例#9
0
def test_pdf():
    with pytest.raises(PDFOpenError):
        pdf = PDF('')
示例#10
0
from carpe_pdf import PDF
from error import *

if __name__ == '__main__':
    with PDF('../samples/damaged_return.pdf') as pdf:
        pdf.parse_content()
        print(pdf.content)
示例#11
0
def test_print_content():
    pdf = PDF('../samples/normal.pdf')
    pdf.parse_content()
示例#12
0
def test_kor_eng_7_metadata():
    pdf = PDF('../samples/kor_eng_word.pdf')
    pdf.parse_metadata()
    assert pdf.metadata
示例#13
0
def test_kor_4_metadata():
    pdf = PDF('../samples/normal_kor_1_4.pdf')
    pdf.parse_metadata()
    assert pdf.metadata
示例#14
0
def test_normal_kor_7_content():
    pdf = PDF('../samples/normal_kor.pdf')  # PDF 1.7 (KOR)
    pdf.parse_content()
    assert pdf.content
示例#15
0
def test_normal_metadata():
    pdf = PDF('../samples/normal.pdf')
    pdf.parse_metadata()
    assert pdf.metadata  # For sequences, (strings, lists, tuples), use the fact that empty sequences are false.
示例#16
0
def test_damaged_parse():
    pdf = PDF('../samples/damaged.pdf')
    assert not pdf.parse()
示例#17
0
def test_normal_check():
    pdf = PDF('../samples/normal.pdf')
示例#18
0
def test_normal_kor_6_content():
    pdf = PDF('../samples/normal_kor_1_6.pdf'
              )  # PDF 1.6 (KOR) => ezPDF Builder Supreme
    pdf.parse_content()
    assert pdf.content