aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_pdf_add_data.py
diff options
context:
space:
mode:
authorben2018-09-18 10:52:38 +0200
committerben2018-09-18 10:52:38 +0200
commitf57654b84b4cf0ffa1287034fc9f66ba200bb259 (patch)
tree5ffb371ce5b5008052e425955f45c8b808ba7fa0 /tests/test_pdf_add_data.py
downloadtruepolyglot-f57654b84b4cf0ffa1287034fc9f66ba200bb259.tar.gz
truepolyglot-f57654b84b4cf0ffa1287034fc9f66ba200bb259.tar.bz2
truepolyglot-f57654b84b4cf0ffa1287034fc9f66ba200bb259.tar.xz
First public commit
Diffstat (limited to 'tests/test_pdf_add_data.py')
-rwxr-xr-xtests/test_pdf_add_data.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_pdf_add_data.py b/tests/test_pdf_add_data.py
new file mode 100755
index 0000000..eb12d93
--- /dev/null
+++ b/tests/test_pdf_add_data.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+import sys
+sys.path.append("../")
+
+import logging
+from PdfFileTransformer import Pdf
+
+
+input_file = "./samples/test1.pdf"
+output_file = "./samples/test1_out.pdf"
+
+logging.basicConfig(level=logging.DEBUG)
+
+p = Pdf(input_file)
+p.insert_new_obj_stream_at_start(b'A' * 140)
+p.insert_new_obj_stream_at_end(b'B' * 120)
+f = open(output_file, 'wb')
+f.write(p.get_build_buffer())
+f.close()