Saravanan666/pypi-org huggingface dataset:
Package: pdf-crop
UsagesCrop all the pages in the PDFpdf_crop -i <str: input PDF file> [--threshold <float: default 0.008>] [--space <int: default 5>]e.g.pdf_crop -i ~/Downloads/test.pdfor specify the space and threshold:pdf_crop -i ~/Downloads/test.pdf --threshold 0.01 --space 3Crop selected pages in the PDFpython ./pdf_crop -i <str: input PDF file> --page <number left top right bottom output> [--page <number left top right bottom output>] [--threshold <float: default 0.008>] [--space <int: default 5>]e.g.pdf_crop -i ~/Downloads/test.pdf --page 0 0 0 200 200 "~/Downloads/test - page 0.pdf"or specify multiple pages:pdf_crop -i ~/Downloads/test.pdf --page 0 0 0 200 200 "~/Downloads/test - page 0.pdf" --page 1 0 0 200 200 "~/Downloads/test - page 1.pdf"Upload to PyPipython3 setup.py sdist bdist_wheeltwine upload -u  -p "" dist/*
Package: pdfcropper
IntroductionThis project provides shellscript for cropping PDF files. It can also remove
specified page from PDF document.DocumentationFull module documentation and description can be found at Read the Docs:http://pdfcropper.readthedocs.org/ContributorsBystroushaak <bystrousak@kitakitsune.org>, DeveloperChangelog1.0.0Fixed missing documentation.Added content of the README.rst.Added czech documentation.0.1.0Project created.
Package: pdfcrowd3
The Pdfcrowd API lets you easily create PDF from web pages or raw HTML
code in your Python3 applications.To use the API, you need an account onpdfcrowd.com, if you don’t have one you can sign uphere. This will give you a username
and an API key.An example:import pdfcrowd

try:
    # create an API client instance
    client = pdfcrowd.Client("username", "apikey")

    # convert a web page and store the generated PDF into a pdf variable
    pdf = client.convertURI('http://example.com')

    # convert an HTML string and save the result to a file
    html="<html><body>In-memory HTML.</body></html>"
    client.convertHtml(html, open('html.pdf', 'wb'))

    # convert an HTML file
    client.convertFile('/path/to/local/file.html', open('file.pdf', 'wb'))

except pdfcrowd.Error as why:
    print('Failed: {}'.format(why))
Package: pdfcutter
# PDFCutterThere are better ways than storing data in a PDF.**pdfcutter** is for when you need to get it out again.Works on XML output of `pdftohtml` which belongs to `poppler-utils`.```pythonimport pdfcuttercutter = pdfcutter.PDFCutter(filename='./some.pdf')name_label = cutter.filter(page=1, search='Name:')name = cutter.filter(page=1).strictly_right_of(name_label).text()```
Package: pdfdata
{pdfdata}Python package for extracting text and data from PDFs.InstallationpipinstallpdfdataUsagefrompdfdataimport*frompprintimportpprint# parse pdf as dictionarypdf_parsed=parse_pdf('pdfs/0641-20.pdf')res=pdf_doc_extract_span_list(pdf_parsed)pprint(res,depth=3)# parse pdf as list of spanspdf_parsed=parse_pdf('pdfs/0641-20.pdf')res=pdf_doc_extract_span_df(pdf_parsed)pprint(res[0])# transform pdf text to jsonnlpdf_text_to_jsonnl('pdfs/0641-20.pdf','0641-20.jsonnl')DevNotesbuildpython-mbuildpypi test uploadpython-mtwineupload--repositorytestpypidist/*--skip-existing
Package: pdfdataprocess
Turning a pdf dataset into CSVIn the rare occasion where researchers publish an entire dataset written in PDF format,such as in the case of this research paper, you need a quick tool to turn that PDF into a CSV file.What happens under the hoodEmbeded nodejs runtimeUsing thenodejs-binpython node runtime, we are able to callnpxto remove execute thepdf2json npm packageWhen you typepdfdataprocessmkjsonThenpxcall applies on the first PDF in your directory. If not found, the path you provide to flag-fis considered.Parsing the JSON-PDFThen a highly hacky python processing  is applied to the JSON-PDF file.The JSON-PDF is a JSON file containing the content of the PDF.The python script iterates through the JSON-PDF and extracts the text content of each page.How this is done is quite simple:if your dataset is an actual CSV file that's printed into PDF, then on each page you will have, at same height (topentry), a line of different values (leftentry changes,dataentry should be rearranged)this requires a few layers of pre and post-processingthe final result is a CSV file with the text content of each pageUsagepdfdataprocessmkjson# outputs the json filethenpdfdataprocesspjson# outputs the csv file
Package: pdf-decomposer
pdf-decomposerFor the convenience of analysis, sometimes it is necessary to extract the content from PDF document.
This project uses local tools to extract images, tables, and text from PDF file.InstallInstall appropriate version of PaddlePaddle and PyTorch. Here is an example using CUDA 11.8.sudo apt install tesseract-ocr
sudo apt install tesseract-ocr-chi-sim

pip install paddlepaddle-gpu==2.5.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install torch torchvision torchaudio -i https://download.pytorch.org/whl/cu118
pip install 'git+https://github.com/facebookresearch/detectron2.git'Install from source code.pip install .orpip install pdf-decomposerIf you are unable to download the layout-parser model automatically, please download it yourself based on the link provided in the error message, and then specify the local config_path and model_path.Solution based on PaddleOCRUse layout analysis and table structure model in PaddleOCR ppstructure to recognize layout elements and reconstruct tables.
Then use PyMuPDF to parse text and organize paragraph.import pdf_decomposer

decomposer = pdf_decomposer.PaddlePDFDecomposer()
decomposer(example_file, output_dir)Alternative local solutionCompared to the Paddle solution, use layout-parser to conduct layout analysis,
and then search adaptive thresholds with genetic algorithm to reconstruct tables.import pdf_decomposer

decomposer = pdf_decomposer.OpenPDFDecomposer()
decomposer(example_file, output_dir)Solution based on Adobe serviceCall Acrobat PDF Services API to extract various elements from PDF files.
Please apply for the API keyhere.
Make sure to set api key before running.export ADOBE_CLIENT_ID=<YOUR CLIENT ID>
export ADOBE_CLIENT_SECRET=<YOUR CLIENT SECRET>import pdf_decomposer

decomposer = pdf_decomposer.AdobePDFDecomposer()
decomposer(example_file, output_dir)
Package: pdfdecrypt
Author:Hartmut Goebel <h.goebel@crazy-compilers.com>Version:Version 0.1Copyright:2022 by Hartmut GoebelLicence:GNU Affero General Public License v3 or later (AGPLv3+)Homepage:https://pdfdecrypt.readthedocs.io/pdfdecryptis a command line tool and a Python library to
remove passwords from PDF documents.  It will read the encrypted
document, ask for the password and write the decrypted document
without touching any internal structure.Requirements when Installating from SourceIf you want to installpdfdecryptfrom source, make sure you have the
following software installed:Python 3(tested with 3.8),pipfor installation, andPyPDF2.Hints for installing on Windows:Following the links above you will
find .msi and .exe-installers. Simply install them and continue
withinstalling pdfdecrypt.Hints for installing on GNU/Linux:Most current GNU/Linux distributions
provide packages for the requirements. Look for packages names likepython-pypdf2. Simply install them and
continue withinstalling pdfdecrypt.Hint for installing on other platforms:Many vendors provide Python.
Please check your vendors software repository. Otherwise please
download Python 3.8 (or any higher version from the 3.x series) fromhttp://www.python.org/download/and follow the installation
instructions there.If the commands below fail due to modulepipnot found,
please install it using:python -m ensurepipInstalling pdfdecryptIf your system has network access installingpdfdecryptis a breeze:pip install pdfdecryptIf you  downloaded and unpackedpdfdecryptjust run:python -m pip install .Without network access downloadpdfdecryptfromhttp://pypi.python.org/pypi/pdfdecryptand run:pip install pdfdecrypt-*.tar.gzFor more details like custom installation locations
please refer tothe official end user guide for installing Python packages.
Package: pdf-diff
pdf-diffFinds differences between two PDF documents:Compares the text layers of two PDF documents and outputs the bounding boxes of changed text in JSON.Rasterizes the changed pages in the PDFs to a PNG and draws red outlines around changed text.The script is written in Python 3, and it relies on thepdftotextprogram.Requirementslibxml2 >= 2.7.0, libxslt >= 1.1.23, popplerRequirements installation for Ubuntu:sudo apt-get install python3-lxml poppler-utilsRequirements installation for OS X:brew install libxml2 libxslt popplerInstallationFrom PyPI:pip install pdf-diffFrom source:sudo python3 setup.py installRunningTurn two PDFs into one large PNG image showing the differences:pdf-diff before.pdf after.pdf > comparison_output.png
Package: pdfdocument
This is a wrapper for ReportLab which allows easy creation of PDF documents:from io import BytesIO
from pdfdocument.document import PDFDocument

def say_hello():
    f = BytesIO()
    pdf = PDFDocument(f)
    pdf.init_report()
    pdf.h1('Hello World')
    pdf.p('Creating PDFs made easy.')
    pdf.generate()
    return f.getvalue()Letters and reportsPDFDocument comes with two different PDF templates, letters and reports. The
only difference is the layout of the first page: The letter has an additional
frame for the address at the top and a smaller main content area.Usage is as follows:pdf.init_report()
# Or:
pdf.init_letter()The letter generates default styles using 9 point fonts as base size, the report
uses 8 points. This can be changed by callingpdf.generate_styleagain.There exists also a special type of report, the confidential report, the only
differences being that the confidentiality is marked using a red cross at the
top of the first page and a watermark in the background.StylesThe call topdf.generate_stylegenerates a set of predefined styles. (Yes
it does!) That includes the following styles; this list is neither exhaustive
nor a promise:pdf.style.normalpdf.style.heading1pdf.style.heading2pdf.style.heading3pdf.style.smallpdf.style.boldpdf.style.rightpdf.style.indentedpdf.style.paragraphpdf.style.tableMost of the time you will not use those attributes directly, except in the case
of tables. Convenience methods exist for almost all styles as described in the
next chapter.ContentAll content passed to the following methods is escaped by default. ReportLab
supports a HTML-like markup language, if you want to use it directly you’ll
have to either use onlypdf.p_markupor resort to creatingpdfdocument.document.MarkupParagraphinstances by hand.Headingspdf.h1,pdf.h2,pdf.h3Paragraphspdf.p,pdf.p_markup,pdf.small,pdf.smallerUnordered listspdf.ulMini-HTMLpdf.mini_htmlVarious elementspdf.hr,pdf.hr_mini,pdf.spacer,pdf.pagebreak,pdf.start_keeptogether,pdf.end_keeptogether,pdf.next_frame,Tablespdf.table,pdf.bottom_tableCanvas methodsCanvas methods work with the canvas directly, and not with Platypus objects.
They are mostly useful inside stationery functions. You’ll mostly use
ReportLab’s canvas methods directly, and only resort to the following methods
for special cases.pdf.confidential,pdf.draw_watermark,pdf.draw_svgAdditional methodspdf.append,pdf.restartDjango integrationPDFDocument has a few helpers for generating PDFs in Django views, most notablypdfdocument.utils.pdf_response:from pdfdocument.utils import pdf_response

def pdf_view(request):
    pdf, response = pdf_response('filename_without_extension')
    # ... more code

    pdf.generate()
    return responseThe SVG support uses svglib by Dinu Gherman. It can be found on PyPI:
<http://pypi.python.org/pypi/svglib/>
Package: pdfdocx
最近运行课件代码，发现pdf文件读取部分的函数失效。这里找到读取pdf文件的可运行代码，为了方便后续学习使用，我已将pdf和docx读取方法封装成pdfdocx包。pdfdocx只有简单的两个读取函数read_pdf(file)read_docx(file)file为文件路径，函数运行后返回file文件内的文本数据。安装pip install pdfdocx使用读取pdf文件frompdfdocximportread_pdfp_text=read_pdf('test/data.pdf')print(p_text)Run这是来⾃pdf⽂件内的内容frompdfdocximportread_docxd_text=read_pdf('test/data.docx')print(d_text)Run这是来⾃docx⽂件内的内容如果如果您是经管人文社科专业背景，编程小白，面临海量文本数据采集和处理分析艰巨任务，可以参看《python网络爬虫与文本数据分析》视频课。作为文科生，一样也是从两眼一抹黑开始，这门课程是用五年时间凝缩出来的。自认为讲的很通俗易懂o(￣︶￣)o，python入门网络爬虫数据读取文本分析入门机器学习与文本分析文本分析在经管研究中的应用感兴趣的童鞋不妨 戳一下《python网络爬虫与文本数据分析》进来看看~更多B站:大邓和他的python公众号：大邓和他的python知乎专栏：数据科学家
Package: pdfdol
pdfdolData Object Layer for PDF dataTo install:pip install pdfdolExamplesGet a dict-like object to list and read the pdfs of a folder, as text:>>> from pdfdol import PdfFilesReader
>>> from pdfdol.tests import get_test_pdf_folder
>>> folder_path = get_test_pdf_folder()
>>> pdfs = PdfFilesReader(folder_path)
>>> sorted(pdfs)
['sample_pdf_1', 'sample_pdf_2']
>>> assert pdfs['sample_pdf_2'] == [
...     'Page 1\nThis is a sample text for testing Python PDF tools.'
... ]See that the values of aPdfFilesReaderare lists of pages.
If you need strings (i.e. all the pages together) you can add a decoder like so:fromdolimportadd_decoderpage_separator='---------------------'pdfs=add_decoder(pdfs,decoder=page_separator.join)If you need this at the level of the class, just do this:fromdolimportadd_decoderpage_separator='---------------------'FilesReader=add_decoder(PdfFilesReader,decoder=page_separator.join)# and thenpdfs=FilesReader(folder_path)# ...
Package: pdfer
Copyright (c) 2021 Lorenzo CoacciPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Description: # pdferA Python library to handle PDFs in general and OCR to read text# Using Docker:
Be sure docker is running and does not require the sudo command anymoreKeywords: pdf,parsing,extract,ocr
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Description-Content-Type: text/markdown
Package: pdferli
Convert PDFs into pandas DataFrames, remove restrictions, put/crack PDF passwordspip install pdferliTested against Windows 10 / Python 3.10 / Anacondacrack_password(file,chars,processes=4,minlen=None,maxlen=None,verbose=True)AttempttocrackaPDFpasswordusingabrute-forceapproach.Args:file(str):PathtotheencryptedPDFfile.chars(iterable):Listofcharacterstogeneratepasswordsfrom.processes(int,optional):Numberofparallelprocessesforpasswordcracking.Defaultsto4.minlen(int,optional):Minimumlengthofgeneratedpasswords.Defaultsto1.maxlen(int,optional):Maximumlengthofgeneratedpasswords.Defaultstolengthofchars+1.verbose(bool,optional):Whethertodisplayprogressinformation.DefaultstoTrue.Returns:str:Crackedpasswordifsuccessful,Noneifnotsuccessfulget_pdfdf(path,normalize_content=False,**kwargs)ExtractstructureddatafromaPDFdocumentandreturnitasapandasDataFrame.Args:path(str):PathtothePDFfile.normalize_content(bool,optional):Whethertonormalizecontentextraction.DefaultstoFalse.**kwargs:Additionalkeywordargumentsforpikepdf.openandextract_pagesmethods.Returns:pandas.DataFrame:DataFramecontainingextractedstructureddatafromthePDF.put_password_encryption(inputfile,outputfile,password)EncryptaPDFfileusingaspecifiedpassword.Args:inputfile(str):PathtotheinputPDFfile.outputfile(str):PathtotheoutputencryptedPDFfile.password(str):Passwordforencryption.remove_restrictions(inputfile,outputfile,**kwargs)RemoveencryptionandrestrictionsfromaPDFfile.Args:inputfile(str):PathtotheinputencryptedPDFfile.outputfile(str):PathtotheoutputdecryptedPDFfile.**kwargs:Additionalkeywordargumentsforpikepdf.savemethod.Examples:fromtimeimportperf_counterfrompdferliimport(crack_password,put_password_encryption,remove_restrictions,get_pdfdf,)put_password_encryption(r"C:\sample.pdf",r"C:\sample4.pdf",password="1234",)path=r"C:\Arquivo.pdf"remove_restrictions(path,"c:\\norestrictions.pdf")df=get_pdfdf(path,normalize_content=False)if__name__=="__main__":# necessary for crack_password since it uses multiprocessingstart=perf_counter()x=crack_password(file=r"C:\sample4.pdf",chars=list("0123456789"),processes=4,minlen=0,maxlen=None,verbose=True,)print(perf_counter()-start)print(x)start=perf_counter()# output dfaa_advaa_bitsaa_colorspaceaa_element_indexaa_element_typeaa_evenoddaa_fillaa_fontnameaa_heightaa_imagemaskaa_linewidthaa_nameaa_sizeaa_srcsizeaa_streamaa_strokeaa_textaa_text_elementaa_text_lineaa_uprightaa_widthaa_x0aa_x1aa_y0aa_y1bb_hierachy_elementbb_hierachy_page031.968<NA><NA>0LTChar<NA><NA>ArialMT56.546172<NA><NA><NA>56.546172<NA><NA><NA>AAPENASVISUALIZAÇÃOATrue11.336388126.431281137.767669242.012331298.558504(0,0,0)(0,0)1<NA><NA><NA>1LTAnno<NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA>\n<NA>False<NA><NA><NA><NA><NA>(0,0,0)(0,0)231.968<NA><NA>2LTChar<NA><NA>ArialMT56.546172<NA><NA><NA>56.546172<NA><NA><NA>PAPENASVISUALIZAÇÃOPTrue11.336388149.036174160.372561264.617224321.163396(0,0,0)(0,0)3<NA><NA><NA>3LTAnno<NA><NA><NA><NA><NA><NA><NA><NA><NA><NA><NA>\n<NA>False<NA><NA><NA><NA><NA>(0,0,0)(0,0)431.968<NA><NA>4LTChar<NA><NA>ArialMT56.546172<NA><NA><NA>56.546172<NA><NA><NA>EAPENASVISUALIZAÇÃOETrue11.336388171.641066182.977454287.222116343.768289(0,0,0)(0,0)
Package: pdf-examiner
DescriptionProvides an overview of the inner file structure of a PDF and extracts /URI and /JS data.Configurationoptions.jsoncontains the rules for searching the PDF document.
If you want to have additional information, just add a new object to this file.
The following provides an example of an object:[{"name":"obj",// The name of the entity which shall// be found. Just acts as a display name"type":"tag",// There are 5 different types://      - metadata//      - action//      - tag//      - code//      - embedded// These types take care of the order within// the output (see example.txt)"action":"count",// There are 2 different actions://      - count (Counts all regex matches)//      - value (Provides the value of a//               regex)"regexes":["(?<!end)obj"]// The regex to find what you need. Make// sure, it matches the selected action}]UsageFrom command line:python -m pdf_investigator [-h] --path PATHOptionShortTypeDefaultDescription--path-pString-Path to the PDF directoryExamplepython -m pdf_investigator -p "path/to/pdf" > result.txtYou can find the following resulthere:################################################################################

PDF Examiner by 5f0
Provides an overview of the inner file structure of a PDF

Current working directory: /path/to/pdfs
Investigated PDFs in: ./sample-files

Total numbers of examined PDFs: 1

Datetime: 01/01/1980 11:12:13

################################################################################

Examined file: ./sample-file/sample.pdf

     MD5 Hash: 851acee02bd8d002e3b9af184d0c8959
  SHA256 Hash: f723638db6e763cf4ccadad38a3d38a02d9ecab95dab1f0aebf00e801991b5f92

--> Version: %PDF-1.5

--> Metadata:

/Author             : ['5f0']
/Creator            : ['LaTeX with hyperref package']
/Producer           : ['pdfTeX-1.40.16']
/CreationDate       : ["D:19700101193102+02\\'00\\'"]
/ModDate            : ["D:19700101193102+02\\'00\\'"]


--> Tags:

obj                 : 6
endobj              : 6
stream              : 5
endstream           : 5
xref                : 0
startxref           : 1
trailer             : 0

--> Actions:

/Action             : 1
/URI                : 2
/URI values         : ['http://example.com/']
/OpenAction         : 1
/Named              : 0
/Launch             : 0
/AcroForm           : 0

---> Code:

/JavaScript         : 2
/JS                 : 1
/JS values          : ['var v = app.viewerVersion;']

---> Embedded:

/RichMedia          : 0
/EmbeddedFile       : 0
/Encrypt            : 2

################################################################################

Execution Time: 0.048780 secLicenseMIT
Package: pdfextools
PdfExToolsThis package contains tools can be used to handle pdf files.1. PageNumberExtractor:to extract physical page numbers, i.e., the page numbers printed in page (as part of content in the page), rather than the logical page numbers tracked by pdf reader or tools like pdfplumber, pymupdf, etc. This can be useful because sometimes the pdf file was excerpted from a large file, as a result, the page number showing in page can start from 135 to 145, while the total number of pages is 11 (1-11).1) to install:pip install PdfExTools2) to use, do the following:from pdfextools import PageNumberExtractor

pdf_file = r"./sample-pdfs/2-col-pubmed.pdf"

print("pdf_file: " + pdf_file)

extractor = PageNumberExtractor()
page_numbers = extractor.process(pdf_file)

print(page_numbers)The result will be a dictionary mapping logical page numbers (base-0) to the physical ones. For example:pdf_file: /sample-pdfs/2-col-pubmed.pdf
{0: 11, 1: 12, 2: 13, 3: 14, 4: 15, 5: 16, 6: 17, 7: 18, 8: 19, 9: 20, 10: 21, 11: 22, 12: 23}
Package: pdfextractor
PDF EXTRACTORThis is an PDF Extractor which can extract Text,Images,Table and Summarize the whole PDF text from the PDF.GITHUB REPO LINK:https://github.com/shehrozkapoor/PDFEXTRACTOR.gitHow to Installpip install pdfextractorordowload source file from GITHUBHOW to UseExtract Tablefrom pdfextractor import Tabletable = Table("pdfPath")extractTableCsv = table.extractTableCsv()extractTableJson = table.extractTableJson()extractTableHTML = table.extractTableHTML()extractSpecPageTableHTML = table.extractSpecPageTableHTML(page_num)extractSpecPageTableCsv = table.extractSpecPageTableCsv(page_num)extractSpecPageTableJson = table.extractSpecPageTableJson(page_num)Extract Imagesfrom pdfextractor import Imageimage = Image("pdfPath")extractImageAll = image.extractImageAll()extractSpecImageMulti = image.extract_images([page_num,page_num...])extractImageSpecPage = image.extractImageSpecPage(page_num)Extract Textfrom pdfextractor import Texttext = Text(pdfPath)extractTextAll = text.extractTextAll()extractTextSpecPage = text.extractTextSpecPage()Extract Summarizefrom pdfextractor import Summarizesummary = Summarize(pdfPath)summarizer = summary.summarizer()
Package: pdffactory
StatusCompatibilitiesContactPdfFactoryA class to update and/or create a pdf object, and add pages to it. For now only matplotlib.figure and
tablewriter.TableWriter objects can be added.Can be opened at the beginning of a long code to add pages from different functions. Will create a file in the
tmp directory where pages are added, and will modify the true file when the update() method is called. update() is
called each time and add_*() method is called. This can be prevented by passing the argument update=False to
those methods. In that case, the user will have to call the update() method later. This can save computation time
if a lot of pages are added during the execution of the code.The output file is recreated by default when update() is called for the first time. This can be switched off by
calling will_recreate(False) before adding anything to the Pdf object. In that case, pages are appended to the
already existing file.The tmp file is deleted after update() finishes, and is recreated later if need be. The tmp file might not be
deleted if the program stops abruptly.Installationpip install pdffactoryUsage# noinspection PyShadowingNamesimportmatplotlib.pyplotaspltimportpandasaspdfromtablewriterimportTableWriterfrompdffactoryimportPdfFactory# Also accepts remote TransparentPath objectspdf=PdfFactory("test.pdf")pdf.will_recreate(False)plt.plot([1,2,3],[1,4,9])df=pd.DataFrame([[1,2,3],[4,5,6]],index=["b","a"])tb=TableWriter(data=df)pdf.add_figure(plt.gcf())pdf.add_table(tb)