self.cell(0, 10, f'Page: {self.page_no()}/nb', 0, 0, 'C') pdf.alias_nb_pages(alias='nb') in case anyone has problems with that thnk you so much
@ChartExplorers3 жыл бұрын
Thanks Enrique! I appreciate it. I looks like this is a change made in the most recent update.
@bibashshrestha94713 жыл бұрын
@@ChartExplorers hlw sir!! This is about opening file from local storage but what i want is as explained below: The output of my python code is a gui tkinter window containing labels and other stuffs which also has a button at bottom side so suppose if my output is the result of exam and i want to download that result as pdf file and save in my computer when i press the button lying at bottom of tkinter window how can i do that?Plz hlp me out....
@ChartExplorers3 жыл бұрын
@@bibashshrestha9471 where are you downloading the pdf from? Is it created with your Tkinter GUI?
@bibashshrestha94713 жыл бұрын
@@ChartExplorers my gui is not creating a pdf neither i m downloading from anywhere. When i jst run my python code , the output is tkinter window containing labels which i want to save as it is in my computer.
@ChartExplorers3 жыл бұрын
@@bibashshrestha9471 Can you send me your code and screen shots. I'm having a hard time understanding what you currently have and what you are trying to accomplish. bradonvalgardson@gmail.com
@kostas69152 жыл бұрын
The diagram and the explanation rocks!!! well done!!! so 10/10
@cameosisj60072 жыл бұрын
That graphical breakdown of that pdf width function 👌🏾
@soureachsak50273 жыл бұрын
The diagram and the explanation is incredibly good. [5-stars review]
@kellymweu27815 ай бұрын
diagram rating 1. Really understood the context
@jpcervone162 жыл бұрын
the diagram illustrated perfectly, I give it a 10!! Thank you so much
@jpcervone162 жыл бұрын
i mean 1 i guess lol
@simaobonvalot76973 жыл бұрын
From 1 to 10 , that explanation of the logic behind the width and centering the tile was a 10. (PRETTY GOOD) ;)
@rhysbennett16673 жыл бұрын
Thank you so much for continuing!!
@ChartExplorers3 жыл бұрын
You're welcome, I'm glad you are enjoying!
@AKKJ4202 жыл бұрын
You are an amazing teacher. Liked and subs
@joebashour3 жыл бұрын
On a scale of 1-10, I think the explanation document deserves a 0 because it really served its purpose well. Great explanation and great video overall (videos actually as there are other parts). Much appreciated!
@mrmuranga3 жыл бұрын
explanation served the purpose...well done and thanks for making the effort to explain
@bipolarchemist2 жыл бұрын
Shoutout for the subtly Pan diagram. Great series, maybe had my programming teachers taught more like you, I would have remained a CS major instead of discovering new horrors in Chemistry.
@ajsunofficial6798 Жыл бұрын
A video needed for creating a pdf file from multiple excel pages in python. It includes tables and charts
@rundeks3 жыл бұрын
Diagram was really well done!
@TheCouncellor7 Жыл бұрын
Awesome tutorial, awesome teacher, 10/10 understanding, 10/10 explanation and 1 for the diagram (didn't go blind :) Thank you very much 👍🙏
@yamenmaani65232 жыл бұрын
this digograme is so awesome
@adrianmisak07 Жыл бұрын
the diagram was excellent
@michaelreis74353 жыл бұрын
Great video series! Thank you. The timing is fortuitous for me and has helped me with a work project. I would certainly be interested in a video about uploading text files to create pdfs.
@ChartExplorers3 жыл бұрын
Thank you. I'm glad it helped. In the fourth video we go over how to create PDFs from txt files. Does that help in what you are trying to do?
@michaelreis74353 жыл бұрын
@@ChartExplorers Yes! Thank you again for making these videos.
@Xaveth3 жыл бұрын
Awesome diagram illustrating the width math! 9.5 for illustration.
@ChartExplorers3 жыл бұрын
Thanks! I went through several iterations of this diagram so I'm glad you liked it :)
@Xaveth3 жыл бұрын
@@ChartExplorers Definitely. I can tell a lot of thought went into that one. One thing to give an answer and a whole other to clearly explain the answer. Nice job!
@ananyobratapal55213 жыл бұрын
For the record, 0 (Ugly) Thank you and keep up the good work ❤️
@hunakosdem Жыл бұрын
As someone with a background of a mechanical engineer I especially love your explanation here: kzbin.info/www/bejne/fJTViGB7iMmMY6M It's a solid 10! Virtually everyone else just runs through their calculations in these cases like "something minus something plus an other something divided by two equals this bit here which we're going to use as a float value of this randomly mentioned parameter" :)
@gabrielabarrera141 Жыл бұрын
Hi, thanks for your video series, very helpful. I have a question... I'm implementing a form (in django) and i don't know how can override the header method passing arguments coming from the form, can you give me a hadn?
@v_tsepish3 жыл бұрын
Thx a lot. Your video helps me so much!
@ChartExplorers3 жыл бұрын
You're welcome, good luck making those PDFs!!
@percyleoncio2 жыл бұрын
Excelente explicación, muchas gracias por ello Como haría si por ejemplo tengo un pdf de 10 páginas, y necesito ponerle como numero de pagina empezando la primera página como número de pagina= 10, la siguiente pagina= 9, y asi llegar a la última página del documento pdf el número de pagina= 1.
@mustafacan2361 Жыл бұрын
Hello sir. Thanks for your records. They were totally helpful for pdf operation. Is there any reason that you did not use fd.readlines() /readline() instead of fd.read().decode() ? (file should be opened as "with open(name) as fd:" for readlines()/ readline() method.)
@MURALIKRISHNAhai3 жыл бұрын
Thank you Could you please explain how to attach existing pdf files to the newly created pdf and establish the links from the newly created pdf to the other added pdf pages instead of writing content from a text file I am using existing pdf files to attach to the pdf made by your lectures and trying to establish the links from top page to other pages
@ChartExplorers3 жыл бұрын
Hi @MURALI KRISHNA, I am actually in working on my next set of videos to describe this. In the mean time this is a great article to get you started realpython.com/creating-modifying-pdf/#using-the-pdffilewriter-class You will have to use the library PyPDF2 library to merge PDFs.
@spiralcarbon86583 жыл бұрын
Thank you Sir. May i ask how to save the output to a specified folder.
@ChartExplorers3 жыл бұрын
You're welcome. To save to a specific folder you will pass the folder path and then the pdf name to pdf.output(). for example if I am on Windows and wanted to save my pdf to my desktop and call it my_pdf.pdf I could use the following pdf.output('C:\Users\bvalg\Desktop\my_pdf.pdf')
@aliuslubas2 жыл бұрын
Thanks a lot for this video. I would be appreciated for a video contaning more information on this regard. with open(name, 'rb') as fh: txt = fh.read().decode('latin-1')
@prudentia82103 жыл бұрын
I have been trying to add a date variable on top right. If i am successful at that then i fail at the initial call which is calling the 'Landscape'
@MateoToquica3 жыл бұрын
thank you so much!!!!
@ChartExplorers3 жыл бұрын
You're Welcome!
@MURALIKRISHNAhai3 жыл бұрын
With FPDF package instead of depending on text files for writing information into our PDF file can we use the existing PDF files to attach to our PDF file. It's like whatever the pdf file we are creating we will create it with the already existing pdf file
@ChartExplorers3 жыл бұрын
Yes you can. I will be putting out a video tomorrow that talks about this problem. The link I sent to you in my other replies talks about how to do this. You will need to use the PyPDF2 library. realpython.com/creating-modifying-pdf/#concatenating-and-merging-pdfs
@ChartExplorers3 жыл бұрын
Hi I released this video a little earlier than I planned. kzbin.info/www/bejne/ZnOYf2mOqZp-brM This discusses how to extract text from PDF files using PyPDF2. It doesn't address your specific question, but should give you a head start on solving your problem. You will have to also use PyPDF2 and FPDF2 to accomplish your goal. I will create a specific video on this topic in the coming days.
@MURALIKRISHNAhai3 жыл бұрын
Hi Mr. Bradon, Here is what I have::: A bunch of PDF files which has complex equations+ tabular headers and footers+ page index etc... Here is what I tried::: 1.I tried what you did in part1,2,3 &4 of handling pdf with python 2.I have converted all those bunch of pdf files into .txt files {But after conversion they look weirdly bad, But I was hoping I could able to reproduce the same good PDF files with those .txt files} 3.I just followed your lectures from part1 to part4 and use those .txt files to create one single PDF with index of every individual pdf file name and activated links {I have used for loop many places to iterate through all .txt files and add them to the wishful large pdf file} Do you think is this the right way to follow. I am dearly waiting for your new video on how to merge pdf files and create a good looking index file after merging to create one single large pdf file
@ChartExplorers3 жыл бұрын
@@MURALIKRISHNAhai If I understand your needs correctly, it sounds like it will be much easier to merge the existing pdf's together will be much easier (because then you can keep the formatting). I'm almost done with the video :)
@MURALIKRISHNAhai3 жыл бұрын
Hi Mr. Bradon, I am very much excited and looking forward to watch your next video on pdf merging with TOC creation.
@jovensaventureiros2 жыл бұрын
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.
@michaelpolicella25882 жыл бұрын
Great teacher. somehow though the text that is displayed on chrome has each line spaced to the complete width of the page. Effectively the words have varying space between them. I have Win10 . Tried all sorts of things but nothing worked and could not find a solution on the web. But really , love the tutorial.
@oladejiolaoluwa9155 Жыл бұрын
i tried using chatgpt to create an article but when i wanted to convert it into pdf using the multi_cell it did not work instead it kept on throwing an error........it said something about decode('latin-1').....please how can i fix this
@souleymanetraore13533 жыл бұрын
Thank you for these videos can u make one on how to concatene pdf files with fpdf please.
@ChartExplorers3 жыл бұрын
Hi Souleymane, fpdf is a library for creating pdf's but it cannot modify (merge split) them. In order to merge or split a pdf you would need to use another library... something like pypdf4 github.com/claird/PyPDF4. I would be happy to make a video on this. I have a couple other videos that I've been working on that I will get out before I can get to this video. Do you have a deadline of when you need this information?
@carlcreighton61573 жыл бұрын
I am doing a web scraper project and am trying to move the text I scrape onto a pdf. however the websites that I am scraping have strange symbols that dont translate into txt files unless you substitute the characters for another. and I cannot decode because they are strings. any advice? python will print the code in run box but will not make it a txt. UnicodeEncodeError: 'latin-1' codec can't encode character '\u2019' in position 999: ordinal not in range(256)
@alexmejia3693 жыл бұрын
Hi Brandon. I'm enjoying your presentation very much. You keep mentioning "...you'll find it in my links.." Where do I find those links Is the presentation code in your links as well? Thank you.
@ChartExplorers3 жыл бұрын
Hi Alex! Usually in the description of the video (you'll probably have to click on show more), but sometimes I mention some content and forget to link to it! Let me know if the link isn't there and I'll get right on it. If by chance you are looking for the link to the documentation you can find it here pyfpdf.github.io/fpdf2/index.html
@AlCatrraz Жыл бұрын
hey... Is there a way to PRINT on the page at any location by the X:Y coordinates? I have AN OOOOLD APP that uses MS ACCESS, and I generate very COMPLEX charts - and may small, framed, pieces of data. and with MANY COLORS... I want to get back into programing, after many years, and this will be a good project for me to do.... Also, is there a way to GO BACK to print on PREVIOUS PAGE? Thanx
@cantstandya37613 жыл бұрын
Hi, one thing I don't seem to understand is the footer and header methods; can't see that they are being called; are these overloaded methods and run automatically by the constructor?
@cantstandya37613 жыл бұрын
Great tutorial by the way.
@cantstandya37613 жыл бұрын
Forget it; found the answer in the api-documentation - and for those interested here is the statement from the documentation; "Footer to be implemented in your own inherited class. This is automatically called by add_page() and close() and should not be called directly by the user application. The default implementation performs nothing: you have to override this method in a subclass to implement your own rendering logic."
@cantstandya37613 жыл бұрын
I'm guessing the same applies to header :)
@rickygevais94123 жыл бұрын
This is great I mainly use Java by using Java I mean started to learn Java but after seeing this I going to switch to python because this looks incredible. How did you manage to come up with this idea? It also looks so professional like a pdf book you would buy, what you made pick 20,000 leagues under the sea? I love the way you used page objects, how did you come up with that, did you design first hand before writing the code.
@ChartExplorers3 жыл бұрын
Thanks Ricky. I can't take credit for this at all. This is up on the FPDF2 tutorial homepage (pyfpdf.github.io/fpdf2/Tutorial.html) I've made a few tweaks here and there to make it a little easier to understand or to demonstrate certain examples more clearly. What do you build with Java?
@rickygevais94123 жыл бұрын
@@ChartExplorers Thanks, I still learning the basics, but mostly things like tic-tac-toe, hangman, sudoku, etc.
@ChartExplorers3 жыл бұрын
@@rickygevais9412 Nice, that's a great place to start!
@rickygevais94123 жыл бұрын
@@ChartExplorers Thanks
@jackatkott74953 жыл бұрын
Hi Bradon, thank you for the awesome tutorial series. One question: Why is the first page blank? What should I do if I want to fill the first page with content too. Cheers and keep up the good work!
@ChartExplorers3 жыл бұрын
Hi Jack, thanks! If you send me your code I could take a look. You're content should start on the first page. bradonvalgardson@gmail.com
@jackatkott74953 жыл бұрын
@@ChartExplorers Found it: pdf.add_page() Thank you for the quick reply!
@ChartExplorers3 жыл бұрын
@@jackatkott7495 awesome!
@tojoeinstein55582 жыл бұрын
how to generate pdf ... data from sqlite
@SachinSharma-vl5wh2 жыл бұрын
UnicodeEncodeError: 'latin-1' codec can't encode character '\u201c' in position 1165: ordinal not in range(256)
@ChartExplorers2 жыл бұрын
Hey! I hate unicode errors!! hmmm, do you have any special characters in the text you are using to create the pdf? If so what is it? I can then try to figure out how to include these special characters.
@mr.68893 жыл бұрын
how to underline an in-between text... like "Hello world this is me" -> i want to underline world, thanks
@ChartExplorers3 жыл бұрын
Hi Mr. Sam! Well sadly to do this it isn't as straight forward as it might seem. I made a short video kzbin.info/www/bejne/eaDdiq2or5yZY80 that describes how to do this. If you ever come across another way of doing this please let me know. The problem is more traditional ways of underlining text don't seem to work with fpdf2.
@imenecharabi89453 жыл бұрын
That diagram isn't ugly at all
@vardhmansoftec73713 жыл бұрын
ALGERIAN font ?
@Lexp2008 Жыл бұрын
Why is no one talking about the fact that the text is only covering half of the page? 😵