Create PDF with Python | Part 4

  Рет қаралды 23,750

Chart Explorers

Chart Explorers

Күн бұрын

Пікірлер: 62
@ahmedmayariwala
@ahmedmayariwala 2 жыл бұрын
Hey! thanks alot for taking your time and making this video. I was struggling for quit a time to understand how to create pdf file and there were not much good tutorials available . but i understood after viewing ur video.
@SajidAli-wy1zs
@SajidAli-wy1zs 3 жыл бұрын
I have seen your heading and subscribed it. Love from Bangladesh.
@jjpratt2699
@jjpratt2699 2 жыл бұрын
Great content, hoping you could make a video on creating a pdf from Excel with Pandas using dataframes 10 columns wide. Some of the columns have text that is wider than the column and needs to be wrapped in the cell. Excel has color coding in some of the cells that need to be transfered to the pdf. Looking on how to accomplish this. Would make a great follow up video to this.
@alanpounds2092
@alanpounds2092 Жыл бұрын
I've enjoyed and learned some very important coding on creating PDF's using Python. I would love it if you would teach on using CSV data that would import it into areas of the PDF document/form or your recommended links to how this is done. Thanks
@bobsimon1554
@bobsimon1554 Жыл бұрын
thanks for this tutorial. how do i link a variable from a form field to this pdf maker ? what is the synthax. ty
@MdMozammelHossain
@MdMozammelHossain 2 жыл бұрын
The output name can I change with some variable, I mean there will be date and time included in output name of pdf.?
@abhishes
@abhishes 2 жыл бұрын
Is there any way to add tooltips to a PDF Cell? so once someone brings their mouse over my cell, they can see some extra information?
@MURALIKRISHNAhai
@MURALIKRISHNAhai 3 жыл бұрын
Hi, Could you please explain how to insert links In an already existing PDF file its like I have a large ine single PDF (A merged pdf with multiple individual pdf files)I would like to make an INDEX with links or How to add links internally to the large PDF file
@ChartExplorers
@ChartExplorers 3 жыл бұрын
Check out this article here: realpython.com/creating-modifying-pdf/#concatenating-and-merging-pdfs I'll answer in more depth when I get a chance!
@ChartExplorers
@ChartExplorers 3 жыл бұрын
Hi Murali, I've been working on how to insert links into already existing PDFs, but am having a difficult time getting tit to work properly (pythonhosted.org/PyPDF2/PdfFileWriter.html). I am going to to keep trying to figure this out. I have a couple more ideas, but I won't be able to get the linking video up as soon as I had hoped.
@mohammed-hananothman5558
@mohammed-hananothman5558 9 ай бұрын
Great video Would love it if you could add in depth videos of layout and positioning like 2 column and 3 layout column etc. Also would love to see you make a video on "Creating a resume pdf using python" Great work overall. loved it. 👍
@MdMozammelHossain
@MdMozammelHossain 2 жыл бұрын
I've one more question, how can I get data from sqlite3 database table to pdf,?
@capincrunch1184
@capincrunch1184 3 жыл бұрын
Another question is there a way you could create a GUI in python to allow users to select anywhere in their computer to save a copy of the pdf instead of setting the location standard
@ChartExplorers
@ChartExplorers 3 жыл бұрын
Hi Kevin, yes there is! tkinter is probably the easiest GUI library to get started with. (ps I'll send you a link to my github in just a second with how to add a table. Sadly it's not possible to use python natively to add a table - that would have been too easy! - so we actually have to use HTML).
@capincrunch1184
@capincrunch1184 3 жыл бұрын
@@ChartExplorers thank you
@capincrunch1184
@capincrunch1184 3 жыл бұрын
@@ChartExplorers just really wanted to see if I could create a GUI so I could allow any user to choose the file destination and file name but I’m having trouble setting it up as an input
@ChartExplorers
@ChartExplorers 3 жыл бұрын
@@capincrunch1184 That would be awesome. GUIs are fun because you can share them with other (no programing) friends.
@namastevis
@namastevis 2 жыл бұрын
Awesome content, exactly what I was looking to learn and use. Where can I find part 5 to automate the creation of reports and invoices?
@jovensaventureiros
@jovensaventureiros 2 жыл бұрын
Hello, before anything I wanna to thank u for this videos, helped me a lot. I wanna ask u if u know how can I fix some error. I'm saving some form in a database and creating PDFs with this data, but the multi_cell attribute isn't work as I expect, it's not breaking lines. Have u have some idea how can I fix this? Again, thx for this videos and congratulations to your channel.
@ayushkathpalia8982
@ayushkathpalia8982 3 жыл бұрын
hey ,amazing video . i have html and css written file and wanted to convert it to pdf . is it possible with fpdf2 lib?
@ChartExplorers
@ChartExplorers 3 жыл бұрын
FPDF2 does support HTML, but sadly not CSS 😥. You can find more details here pyfpdf.github.io/fpdf2/HTML.html
@Achiesamablog
@Achiesamablog 3 жыл бұрын
Does fpdf2 have this cell method?
@sheen8270
@sheen8270 Жыл бұрын
Thank you for these video tutorials! I have run into an issue when it comes to creating the internal links to chapters 1 and 2. for now, under the section where links are created, I had to add the page numbers like this: ch1_link = pdf.add_link(page=2) ch2_link = pdf.add_link(page=6) Even if I copy part_4.py exactly I was getting the following error: File "H:\python\pypdf\.venv\Lib\site-packages\fpdf\fpdf.py", line 2093, in link raise ValueError( ValueError: Cannot insert link 1 with no page number assigned If I figure out a way to work around this, I'll update but for now I wanted to mention in case anyone else runs into the same issue.
@rhysbennett1667
@rhysbennett1667 3 жыл бұрын
Thanks for the continued videos, the are helping me out so much!
@ChartExplorers
@ChartExplorers 3 жыл бұрын
Thanks so much! I'm glad they have been helpful :D
@capincrunch1184
@capincrunch1184 3 жыл бұрын
how would i go about creating a table or lines in a pdf
@ChartExplorers
@ChartExplorers 3 жыл бұрын
What format is your data in? List of lists, dictionary, pandas dataframe, numpy array...
@capincrunch1184
@capincrunch1184 3 жыл бұрын
@@ChartExplorers numpy array
@capincrunch1184
@capincrunch1184 3 жыл бұрын
@@ChartExplorers actually list
@ChartExplorers
@ChartExplorers 3 жыл бұрын
@@capincrunch1184 Here is a github link github.com/bvalgard/create-pdf-with-python-fpdf2/blob/main/table.py that will take you to an example py file. I was hoping we could use tabulate to create a table, but that is not supported in FPDF2. So we have to create our table with HTML which is much more work. I'm going to keep working on this and then one day I'll make a video explanation on this. There are a lot of tutorials online on how to make a HTML table. You can also ask me and I'll do my best to help out.
@capincrunch1184
@capincrunch1184 3 жыл бұрын
@@ChartExplorers had no idea you could write code like that in python
@adamfatyga7977
@adamfatyga7977 2 жыл бұрын
How to create easy table on pdf? I dont need 'fireworks', just sortet data.
@ElinLiu0823
@ElinLiu0823 3 жыл бұрын
That was a pretty good tourial and i am using what you teached to help my uncle to make automatically Enneagram report for him. Based with Plotly Express and Selenium Scraping Tools.
@matiasr1373
@matiasr1373 3 жыл бұрын
Thanks for the videos!
@gambu4810
@gambu4810 2 жыл бұрын
I love it
@lilicrashes
@lilicrashes 3 жыл бұрын
This is great!! can you do even more expansion? Like auto printing reports or charts from excel or dataframes?
@ChartExplorers
@ChartExplorers 3 жыл бұрын
Hi Acr Rca, thanks and thanks for the ideas. I've added them to my list of video topics :)
@capincrunch1184
@capincrunch1184 3 жыл бұрын
Thank you for the videos
@capincrunch1184
@capincrunch1184 3 жыл бұрын
I have a question about setting where to save the pdf
@ChartExplorers
@ChartExplorers 3 жыл бұрын
@@capincrunch1184 Are you wondering how to save the pdf somewhere else other than the directory that your .py file is in?
@capincrunch1184
@capincrunch1184 3 жыл бұрын
@@ChartExplorers yes
@ChartExplorers
@ChartExplorers 3 жыл бұрын
@@capincrunch1184 what you can do is pass in the path to where you want your file to be saved to pdf.output For example: pdf.output(r'C:\Users\bvalg\Documents\Pdf'Folder\my_pdf.pdf) here the r infront of the file path string indicates it's a raw string which will strip any specail values a character might have (this is particularly important for Windows users where file paths contain backslashes which have a special value to escape a character)
@capincrunch1184
@capincrunch1184 3 жыл бұрын
@@ChartExplorers oh ok thank you I’ll try it out thanks for the help and the videos, the videos are incredible help
@fernandalopez3149
@fernandalopez3149 3 жыл бұрын
Amazing tutorial! I have one question, how can I add an image on the body of the PDF?
@ChartExplorers
@ChartExplorers 3 жыл бұрын
Thanks! If you want an image in the body of the pdf then use pdf.add_page() to create a new page followed by pdf.image('image_location_and_name.png'). That will place the image on the page you just created.
@fernandalopez3149
@fernandalopez3149 3 жыл бұрын
@@ChartExplorers Thank you!
@Pandimoori_krish
@Pandimoori_krish 3 жыл бұрын
Hi I have excel file in that second column text i mean address dono ,mobile no, pincode so how to retrive only mobile number using pandas dataframe
@ChartExplorers
@ChartExplorers 3 жыл бұрын
Could you give me an example of what the column looks like? Is it a list [address, phone number, pincode], a string 'address, phone number, pincode', or something else? Is each field separated by a comma, white space, semi-colon? Do the phone numbers all follow the same pattern i.e., (555) 867-5309?
@ChartExplorers
@ChartExplorers 3 жыл бұрын
@hi -- (email removed)
@Pandimoori_krish
@Pandimoori_krish 3 жыл бұрын
@@ChartExplorers Thank you
@ChartExplorers
@ChartExplorers 3 жыл бұрын
@@Pandimoori_krish I just responded to your email.
@Pandimoori_krish
@Pandimoori_krish 3 жыл бұрын
@@ChartExplorers Thank you so much
@sparqllord8831
@sparqllord8831 3 жыл бұрын
You really need to include something about adding images. A PDF without images is like a soda without sugar. Everybody talks about images in header and footer, but the most interesting is floating images in the body of the document. The usually problem is that you want to include from 1 to X pictures without any clue about X. Only that you want to have them like 2 and 2 fitted horizontally at specific places within the text.
@ChartExplorers
@ChartExplorers 3 жыл бұрын
hmmmm, soda without sugar! Yuck :p Good analogy. I see where you are coming from. I should make a more in depth video on adding x number of images to a pdf and image placement. in the body of the pdf. Do you have any specific needs / suggestions for examples I could base the video off of? Have you seen Kieth's pdf video? He uses pyfpdf (fpdf2 is based off of pyfpdf so the syntax is very similar) kzbin.info/www/bejne/i56xY5KIabB4nZo Is this the type of pdf you talking about? I think it would be beneficial to have an image and text side by side.
@sparqllord8831
@sparqllord8831 3 жыл бұрын
@@ChartExplorers Good suggestion - but have already seen it, thanks. My particular case is not a general one so it's not a good example. A more relatable problem would be having a database with a lot of information about both companies and their subsidiaries. The task is to generate a presentation of the hole family - one PDF for each company and its subsidiaries. So first list up the basics about the mother company - name, address, etc - then include some pictures (paths are found in the database) followed by some more text and different kind of images. Then under subsections in the PDF present the same kind of information about each of the subsidiaries. The amount of information about each company varies so everything need to be dynamic.
@ChartExplorers
@ChartExplorers 3 жыл бұрын
@@sparqllord8831 thanks for the example. Yes, this is much more complex than any tutorial I've seen on KZbin. It sounds like a fun problem / project. Let me do some digging and practicing to see what I can come up with. If I can come up with anything worth sharing I'll send you a link to github with some possible solutions. I'll also make a video on it, but videos take a while to make. Do you have a deadline?
@sparqllord8831
@sparqllord8831 3 жыл бұрын
@@ChartExplorers @Chart Explorers Deadline is as always tomorrow, but I'll find a workaround. After doing everything in SAS for years I'm new to Python. Hope to do lots of fun stuff in the future and PDFs are always in demand - so I'm interested anyhow. Thanks a lot for great and fast response.
@ChartExplorers
@ChartExplorers 3 жыл бұрын
​@@sparqllord8831 Isn't that how it always is!! I'll get working on some type of a solution so if there is a next time you'll be ready to automate the process :)
Create PDF with Python | Part 3
16:36
Chart Explorers
Рет қаралды 35 М.
Create PDFs in Python FULL TUTORIAL
31:22
BigPlot
Рет қаралды 10 М.
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Extract Text from PDF with Python
13:53
Chart Explorers
Рет қаралды 40 М.
Create PDF with Python | Part 2
11:37
Chart Explorers
Рет қаралды 51 М.
Create PDF with Python | Part 1
10:03
Chart Explorers
Рет қаралды 121 М.
How to Create PDF Files with Python [New Method 2024]
22:27
The PyCoach
Рет қаралды 58 М.
Extract PDF Content with Python
13:15
NeuralNine
Рет қаралды 233 М.
Jupyter productivity hacks for the speedy analyst
9:02
Chart Explorers
Рет қаралды 7 М.
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН