简体   繁体   中英

ReportLab import PDF, Acrobat

I am trying to embed various PDF documents into my ReportLab canvas. It seems that maybe you can hack in support for SVG (but I really need PDF).

If you want pure python, the proper way is to pay for the commercial ReportLab-PLUS addons, which includes PageCatcher , a mighty powerful artwork/PDF toolset.

Im not ready for the PLUS upgrade just yet, but I have one other potential solution: Adobe Acrobat . I use Acrobat quite often, but I have never attempted to automate it (using python+COM I suppose).

I dont want to just slam PDFs together, because it will ruin indexing and Table Of Contents generated by ReportLab. What I would need to do is set some type of placeholder in ReportLab that simply takes up space, yet, it would need to leave some type of identifier for Acrobat to look for and replace. I will plan to fill in entire pages in Acrobat.

Any idea how I can create this placeholder from the ReportLab side? It almost seems like I would want to embed metadata in the PDF that gives Acrobat exact instructions for the insertion. I also suppose adding actual entities could work, and then Acrobat will need to remove them or cover them up.


I am try to merge AutoCAD drawings, Vector illustrations, and assorted reStructuredText snippets (using rst2pdf).

There is a python module, pyPDF , that can also be used to slice-and-dice PDF's.

This could be used if you had already exported you Assets using the native program (example printing an AutoCAD drawing as a PDF, from within AutoCAD itself). Acrobat is pretty good at magically guessing how this should be done when using those difficult Proprietary applications with specialized formats.

The disadvantage (from an automation point-of-view): is that now we probably need to script AutoCAD to output the PDF in an organized way, so that we can pass it on to pyPDF. (Or we do these kinds of things by hand, but that is not very scalable).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM