+ 2

Coding to print in word or pdf

Is there a way to set the code you make to type out something in a word or pdf format as a final product

19th Jan 2017, 12:11 PM
Shane Gibson
Shane Gibson - avatar
7 Respostas
+ 11
I think you can created TEX or HTML and converted file to pdf.
19th Jan 2017, 1:00 PM
Sergey
+ 3
there are probably ways to save to .docx - if I remember right docx files are variety of XML. This screams "use a library API or module for this" to me - rather than code it all yourself. Also for HTML I've got some code in the playground that you can feel free to rip off and do as you please if it helps at all - name is something like "(add to me) python writing HTML". Though that code is really basic at the mo, and to extend it you'll need to learn a load of tags of HTML
26th Jan 2017, 3:57 AM
Phil
Phil - avatar
+ 2
so I will have to get some1 that knows html
19th Jan 2017, 1:41 PM
Shane Gibson
Shane Gibson - avatar
+ 2
thanks I will take a look and see. if I get stuck will give u a shout
26th Jan 2017, 4:13 AM
Shane Gibson
Shane Gibson - avatar
+ 2
I found some good stuff by googling "python pdf library" and for "python docx library" (docx is the default file extension for word docs these days - ages ago it was doc) plenty of good seeming results on the first page on both searches. Python-docx looks great to me from a quick nose through documentation.
26th Jan 2017, 2:33 PM
Phil
Phil - avatar
0
I don't know if I'm going in the right direction. I'm trying to create an input code for an app where for example hole lot of questions followed by a reader input finally when saved will print all the Q&A to a pdf doc and email it to the reader as well as an off site email in the form of pdf. ya complicated right
26th Jan 2017, 5:21 PM
Shane Gibson
Shane Gibson - avatar
0
can you point me in the right direction
26th Jan 2017, 5:21 PM
Shane Gibson
Shane Gibson - avatar