pdf-generation

ImportError: cannot import name COMError in python

故事扮演 提交于 2019-12-12 12:10:15
问题 I am trying to convert docx file to pdf with following code import sys import os import comtypes.client wdFormatPDF = 17 in_file = os.path.abspath(sys.argv[1]) out_file = os.path.abspath(sys.argv[2]) word = comtypes.client.CreateObject('Word.Application') doc = word.Documents.Open(in_file) doc.SaveAs(out_file, FileFormat=wdFormatPDF) doc.Close() word.Quit() It is throwing an error ImportError: cannot import name COMError I have installed comtypes package. I am very new to python, I can not

Exporting multiple sheets to .pdf via VBA code

不羁岁月 提交于 2019-12-12 11:00:03
问题 I have seen this question but it doesn't quite answer my question - excel vba not exporting pagesetup to pdf correctly I have the same problem of the specified ranges in each sheet not being exported when utilising code to create the .pdf output. Everything on each sheet is exported so each worksheet is spread across two or more pages. The print ranges for each sheet are set up to print the specified area onto one sheet. I have tried to adapt the code in the link but it doesn't seem to work

Merge FDF and PDF without PDFTK

狂风中的少年 提交于 2019-12-12 10:45:15
问题 Is there a way to merge FDF file and a PDF File to create a flat format of all the data and form into 1 pdf without using PDFTK? Any light shed upon this would be greatly appreciated. 回答1: No.. There's no other way easy way to flatten, but it's awesome. Why would you need anything else? PDFTK is actually mostly Java (literally hundreds of Java files). You could think about wrapping your own project around it. The functionality that you're looking for is here (java/com/lowagie/text/pdf

generating Persian PDF with iText

巧了我就是萌 提交于 2019-12-12 10:43:33
问题 Hi I know that many people may have asked this question before. I've read almost all of them`but it couldn't help me solve my problem. I'm using iText java library to generate a Persian PDF. I'm using the following code: Document document = new Document(PageSize.A4,50,50,50,50); FileOutputStream fos = new FileOutputStream("D:\\ITextTest.pdf"); PdfWriter writer = PdfWriter.getInstance(document,fos); document.open(); BaseFont bf = BaseFont.createFont("C:\\Windows\\Fonts\\XB YagutBd.ttf",

Dynamic HTML to PDF

倾然丶 夕夏残阳落幕 提交于 2019-12-12 10:37:27
问题 I need to be able to convert dynamic HTML (html that is rendered on page load by javascript) to a PDF. I know there are plenty of HTML to PDF converters but none of the ones I have found thus far cope with dynamic HTML. The given tool should be able to successfully convert the following page - http://www.simile-widgets.org/timeline/ Cheers Anthony UPDATE: I don't need the JavaScript functionality here... i.e. i don't need to be able to interact screen... I just want the finial rendering of

Prawn html formatting

本小妞迷上赌 提交于 2019-12-12 09:41:46
问题 I have some simple lists and bold/italic text to format with prawn. How do I get prawn to pay attention to the html tags instead of just displaying them explicitly. If prawn can't do this, what are my other options? 回答1: Inline formatting has been completely re-instated in the development version of Prawn. You can use the code off of the stable branch (0.9.x) for stability, or track master, where we just merged inline styling support for tables. See notes at: http://wiki.github.com/sandal

How do i download pdf file over https with python

蹲街弑〆低调 提交于 2019-12-12 09:34:05
问题 I am writing a python script, which will save pdf file locally according to the format given in URL. for eg. https://Hostname/saveReport/file_name.pdf #saves the content in PDF file. I am opening this URL through python script : import webbrowser webbrowser.open("https://Hostname/saveReport/file_name.pdf") The url contains lots of images and text. Once this URL is opened i want to save a file in pdf format using python script. This is what i have done so far. Code 1: import requests url=

C# PDF Printing Library [closed]

为君一笑 提交于 2019-12-12 09:28:17
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Are there any free libraries that would "print" to a PDF without actually having to install a PDF printer on the system. I want

Rails3 - wicked_pdf gem, footer issue when calling from action mailer model

喜你入骨 提交于 2019-12-12 08:16:27
问题 I'm using wicked_pdf pdf_from_string inside an action mailer rails 3 model. The pdf render perfectly doing this: attachments["pdf.pdf"] = WickedPdf.new.pdf_from_string( render_to_string(:pdf => "pdf.pdf",:template => 'documents/show.pdf.erb') ) When I try to pass the option :footer, it does not work with these options: attachments["pdf.pdf"] = WickedPdf.new.pdf_from_string( render_to_string(:pdf => "pdf.pdf", :template => 'pdf/pdf.html.erb', :layout => 'pdfs/pdf', :footer => {:html => {

PDF Tj command with angle brackets?

夙愿已清 提交于 2019-12-12 08:11:49
问题 I'm trying to figure out where in an uncompressed PDF v1.4 document the Times font is used. The /Font object describing the Times font within the PDF is object 65 as follows: 65 0 obj <</Type /Font /Subtype /TrueType /BaseFont /PXAAAD+TimesNewRoman,Italic /FirstChar 1 /LastChar 35 /Widths [250 333 333 333 500 500 500 500 500 500 500 500 500 500 333 722 722 833 666 610 500 556 500 443 443 500 277 443 500 389 389 277 500 443 500] /FontDescriptor 205 0 R /ToUnicode 206 0 R>> endobj It refers to