d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Working With A Pdf.
Add Reply New Topic New Poll
Member
Posts: 20,287
Joined: Mar 22 2007
Gold: 290.00
Dec 13 2016 02:18pm
Hello guys.
I am wondering if any of you know about a good way to
create pdf files from a GUI in python?

Thanks in advance.
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Member
Posts: 20,287
Joined: Mar 22 2007
Gold: 290.00
Dec 14 2016 06:50am
Quote (carteblanche @ 14 Dec 2016 01:01)


Thanks for the link.
I should probably have specified a bit more.
The GUI lets users enter text into a ScrolledText field, which then lets them
save their input in a .txt file. Is there a way to do this with PDF files that won't be too much hassle?
Or if there isn't such a way, could I format their input so that the .txt file is better suited for printing?

Thanks in advance.
Member
Posts: 36,389
Joined: Jul 18 2008
Gold: 3,192.00
Dec 15 2016 07:31am
Formatting text for pdf files is kind of a pain. Just simple
Plain text would be kind of easy.

Look at the reportlab library and its platypus package.
Member
Posts: 20,287
Joined: Mar 22 2007
Gold: 290.00
Dec 16 2016 08:09am
Quote (Mastersam93 @ 15 Dec 2016 15:31)
Formatting text for pdf files is kind of a pain. Just simple
Plain text would be kind of easy.

Look at the reportlab library and its platypus package.


Yeah. That's what I figured.
Was looking at reportLab, but I don't know really know yet if I want to go that route.
Do you know any methods for getting the users input neatly formatted in a template if I decide to stay with only .txt files?

I am very new to programming, so every tip or trick is greatly appreciated!
Thanks in advance.
Member
Posts: 36,389
Joined: Jul 18 2008
Gold: 3,192.00
Dec 17 2016 07:04pm
Quote (zlettn @ Dec 16 2016 09:09am)
Yeah. That's what I figured.
Was looking at reportLab, but I don't know really know yet if I want to go that route.
Do you know any methods for getting the users input neatly formatted in a template if I decide to stay with only .txt files?

I am very new to programming, so every tip or trick is greatly appreciated!
Thanks in advance.


Well reportlab supports a lot of basic html tags, like <b> and <i>, so those might help.
Member
Posts: 20,287
Joined: Mar 22 2007
Gold: 290.00
Dec 20 2016 08:33am
Quote (Mastersam93 @ 18 Dec 2016 03:04)
Well reportlab supports a lot of basic html tags, like <b> and <i>, so those might help.


I've kinda found a solution to the problem.
However, I am now presented with a new problem.
I am required to use classes in this GUI design, but I am having slight difficulties
in getting the functions that writes the input to files to work within/from a class.
Is there any basic way to implement that functionality to a class? Or at least to call the function in a non-messy way?

Thanks for any input.

This post was edited by zlettn on Dec 20 2016 08:37am
Member
Posts: 20,287
Joined: Mar 22 2007
Gold: 290.00
Dec 21 2016 04:24am
Sorted the previous problem. Now I am only faced with some class inheritance issues.

Thanks again for you reply!
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll