pdf-generation

Is there any direct way to generate pdf from markdown file by python [closed]

旧街凉风 提交于 2019-12-02 20:15:52
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . As the title, I want to use markdown as my main write format and I need to generate PDF files from markdown using pure python. JasonFruit I have done and would do it in two steps. First, I'd use python-markdown to make HTML out of my Markdown, and then I'd use xhtml2pdf to make a PDF file. Edit (2014): If I were doing this now, I might choose WeasyPrint as my HTML-to-PDF tool; it does a

Python: Create automated strictly-designed multi-page .pdf report from .html

只谈情不闲聊 提交于 2019-12-02 19:35:59
What are good Python-based options to create strictly designed .pdf reports from .html? I've attached a draft .pdf to illustrate the following points: The design of the report is rather strictly designed. In other words "Looks matter". The report contains complex vector graphics (package: Matplotlib ).These may slightly differ in size . The report contains images. The report contains a large number of numbers / strings filled in dynamically. Optimally, the solution would use open source packages. We create our .html with Django . The report may span multiple pages. It looks as if there was

Get the whole page as a PDF [closed]

我的梦境 提交于 2019-12-02 19:16:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Question: I want a button on my page on clicking which the whole content of the page is saved in the form of pdf. Queries: So any one has any idea that, is there any library or assembly or any piece of code that can provide me with this feature? Thanks in advance 回答1: body part <asp:PlaceHolder ID=

Java load image from database as the byte stream and load it in xsl

主宰稳场 提交于 2019-12-02 18:39:37
问题 Image saved in the database as byte stream , I have to load that image in the xsl. In xsl whether loading the image from the database is possible ?? If so How it can be done. In xsl we used to load the static image only , but I need to load the dynamic content 回答1: Let's assume you have some database and you are storing an image that you can retrieve in some way. The image is identified by some ID ... like "1234567". Then assume your XML has something in it, like: <imageid>1234567<imageid>

How to generate multiple reports in Grails using Export plugin?

青春壹個敷衍的年華 提交于 2019-12-02 18:28:15
问题 I am using the Export plugin in Grails for generating PDF/Excel report. I am able to generate single report on PDF/Excel button click. But, now I want to generate multiple reports on single button click. I tried for loop, method calls but no luck. Reference links are ok. I don't expect entire code, needs reference only. 回答1: If you take a look at the source code for the ExportService in the plugin you will notice there are various export methods. Two of which support OutputStream s. Using

Add anchor to pdf using itext java

安稳与你 提交于 2019-12-02 17:51:07
问题 I am trying to add anchor(named destinations) to pdf using itext java api. But it's not working.When I click the text , nothing happens.This is what I am doing . Anchor anchor = new Anchor("Jump down to next paragraph"); anchor.setReference("#linkTarget"); Paragraph paragraph = new Paragraph(); paragraph.add(anchor); document.add(paragraph); Anchor anchorTarget = new Anchor("This is the target of the link above"); anchor.setName("linkTarget"); Paragraph targetParagraph = new Paragraph();

Split each PDF page in two?

走远了吗. 提交于 2019-12-02 17:10:13
I have a large number of PDF files which have two slides to a page (for printing). The format is A4 pages each with two slides setup like so: ----------- | slide 1 | ----------- | slide 2 | ----------- How can I generate a new PDF file with one slide per page? Happy to use GUI, CLI, scripts or even interface with a language's PDF library; but I do need the text on the slides to still be selectable. stackoverflowuser95 PDF Scissors allowed me to bulk split (crop) all pages in a PDF. Briss is "a simple cross-platform (Linux, Windows, Mac OSX) application for cropping PDF files. A simple user

iTextSharp adding new instances of an existing page

三世轮回 提交于 2019-12-02 16:48:17
问题 Let's say I have a three page PDF and all three of them have AcroFields. I need to be able to generate a new PDF with page 2 repeated N number of times. Each new instance of page 2 will need to have the field names modified to make them distinct from the other instances of page 2. Can someone who's solved this problem before provide a syntax example? 回答1: This is explained in the MergeForms2 example. You should split your document into 3 documents each having one page. Use the renameFields()

TCPDF remote image loading problem

女生的网名这么多〃 提交于 2019-12-02 16:03:02
问题 Im trying to load a remote image into a pdf generated by tcpdf however I can't seem to get it to work? The rest of the pdf loads fine and it looks like to trying to retrieve the image however it just does print to the page? The code I am using is: $pdf->Image("http://media.domain.com/logo.jpg", 0, 0, 100, 150, 'JPEG', '', 'T', true, 72,'','','','','','',''); Any help on this would be a massive help, Thanks, 回答1: I think you need to set allow_url_fopen = On in php.ini It works for me $pdf-

How to give width, height, x and y coordinates in generating pdf from html using JSPDF new html API

若如初见. 提交于 2019-12-02 14:59:56
问题 I have been using JSPDF to generate pdf document based on some html. Earlier using jspdf fromHTML Api, we could give margins like this var margins2 = { top: 415, bottom: 10, left: 55, width: 300 }; doc.fromHTML(reactListContent, margins2.left, margins2.top, { 'width': margins2.width, 'elementHandlers': specialElementHandlers }, margins2); But, in the new .html API , how can i provide margins, width and height. The new API is like var pdf = new jsPDF('p', 'pt', 'letter'); pdf.html(document