diff --git a/docs/examples.md b/docs/examples.md index 291d9063..4178cb72 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -3,7 +3,7 @@ This part of the documentation provides some useful example code snippets that can be used out of box. -## Preparing PDF Form +## Preparing a PDF Form The most common tool to create a PDF form is Adobe Acrobat. A tutorial can be found [here](https://helpx.adobe.com/acrobat/using/creating-distributing-pdf-forms.html). @@ -26,11 +26,11 @@ PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM = os.path.join( os.path.expanduser("~/Downloads"), "sample_template.pdf" ) # Change this to where you downloaded the sample PDF form -PATH_TO_FILLED_PDF_FORM = os.path.join( +PATH_TO_PDF_FORM_PREVIEW = os.path.join( os.path.expanduser("~"), "output.pdf" -) # Change this to where you wish to put your filled PDF form +) # Change this to where you wish to put your PDF form preview -with open(PATH_TO_FILLED_PDF_FORM, "wb+") as output: +with open(PATH_TO_PDF_FORM_PREVIEW, "wb+") as output: output.write( PyPDFForm(PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM).preview ) @@ -286,11 +286,11 @@ PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM = os.path.join( os.path.expanduser("~/Downloads"), "sample_template.pdf" ) # Change this to where you downloaded the sample PDF form -PATH_TO_FILLED_PDF_FORM = os.path.join( +PATH_TO_OUTPUT_PDF_FORM = os.path.join( os.path.expanduser("~"), "output.pdf" -) # Change this to where you wish to put your filled PDF form +) # Change this to where you wish to put your output PDF form -with open(PATH_TO_FILLED_PDF_FORM, "wb+") as output: +with open(PATH_TO_OUTPUT_PDF_FORM, "wb+") as output: output.write( PyPDFForm(PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM) .draw_text("drawn_text", 1, 300, 225) @@ -311,15 +311,15 @@ PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM = os.path.join( os.path.expanduser("~/Downloads"), "sample_template.pdf" ) # Change this to where you downloaded the sample PDF form -PATH_TO_FILLED_PDF_FORM = os.path.join( +PATH_TO_OUTPUT_PDF_FORM = os.path.join( os.path.expanduser("~"), "output.pdf" -) # Change this to where you wish to put your filled PDF form +) # Change this to where you wish to put your output PDF form PATH_TO_IMAGE = os.path.join( os.path.expanduser("~"), "sample_image.jpg" ) # Change this to the location of an image of your choice -with open(PATH_TO_FILLED_PDF_FORM, "wb+") as output: +with open(PATH_TO_OUTPUT_PDF_FORM, "wb+") as output: output.write( PyPDFForm(PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM) .draw_image(PATH_TO_IMAGE, 2, 100, 100, 400, 225, 0) @@ -340,11 +340,11 @@ PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM = os.path.join( os.path.expanduser("~/Downloads"), "sample_template.pdf" ) # Change this to where you downloaded the sample PDF form -PATH_TO_FILLED_PDF_FORM = os.path.join( +PATH_TO_OUTPUT_PDF_FORM = os.path.join( os.path.expanduser("~"), "output.pdf" -) # Change this to where you wish to put your filled PDF form +) # Change this to where you wish to put your output PDF form -with open(PATH_TO_FILLED_PDF_FORM, "wb+") as output: +with open(PATH_TO_OUTPUT_PDF_FORM, "wb+") as output: filled_pdf = PyPDFForm() for i in range(3): @@ -424,11 +424,11 @@ PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM = os.path.join( os.path.expanduser("~/Downloads"), "sample_template.pdf" ) # Change this to where you downloaded the sample PDF form -PATH_TO_FILLED_PDF_FORM = os.path.join( +PATH_TO_NEW_VERSION_PDF_FORM = os.path.join( os.path.expanduser("~"), "output.pdf" -) # Change this to where you wish to put your filled PDF form +) # Change this to where you wish to put your new version PDF form -with open(PATH_TO_FILLED_PDF_FORM, "wb+") as output: +with open(PATH_TO_NEW_VERSION_PDF_FORM, "wb+") as output: output.write( PyPDFForm(PATH_TO_DOWNLOADED_SAMPLE_PDF_FORM) .change_version("2.0")