示例#1
0
 def test_pdf_to_images(self):
     if not os.popen("which pdftoppm").read().strip():
         warn("pdftoppm not found, skipping test")
         return
     blob = self.read_file("onepage.pdf")
     image = converter.to_image("", blob, "application/pdf", 0)
     assert "image/jpeg" == mime_sniffer.from_buffer(image)
示例#2
0
def test_pdf_to_images(converter):
    if not os.popen("which pdftoppm").read().strip():
        warn("pdftoppm not found, skipping test")
        return
    blob = read_file("onepage.pdf")
    image = converter.to_image("", blob, "application/pdf", 0)
    assert "image/jpeg" == mime_sniffer.from_buffer(image)
示例#3
0
 def test_pdf_to_text(self):
     if not os.popen("which pdftotex").read().strip():
         warn("pdftotext not found, skipping test")
         return
     blob = self.read_file("onepage.pdf")
     text = converter.to_text("", blob, "application/pdf")
示例#4
0
 def test_pdf_to_text(self):
   if not os.popen("which pdftotex").read().strip():
     warn("pdftotext not found, skipping test")
     return
   blob = self.read_file("onepage.pdf")
   text = converter.to_text("", blob, "application/pdf")