Is there a newer/better tool than xhtml2pdf, cause it seems like this tool doesn't support lots of css features and is only made for very simple html pages. But for me it doesn't work with elements that have posiotion absolute or even a clip-path. Do you know a tool, that supports all css?
brother thank you very much. I have a question that if i want to insert the data into invoice from database then how to code views function so that i can insert into invoice html file. could you please help me.
First query the database for the data you want, and then create a dictionary from it. The new dictionary will replace the static data dictionary that he has. Let me me know if you need help with that.
@@wethepeopleofghana8441 i have a similar problem. I need a dynamic dictionary that depends the user selection. My problem is when going from one url[index] to another[function print], the variables change their value to None. you can help me pls?
same issue, i provide a function for link_callback variable to perform the path of css file to an absolute path at my host machine, but css doesn't work.
Hey dennis, actually i was working on an e-commerce website as a project. Then i came across the feature to render invoice to pdf and send it through e-mail. And your video helped alot. So Thank you💐. Also, i wanted your little help. Actually i am unable to print product(s) details on pdf, it says "you are passing more than 1 object" when there is more than 1 product. It's the "orderItem" model, and it is based on your e-commerce website video. Will you please help me with this?
That works OK!! Thanks Dennis. I cant figure out how to attach the generated pdf to an email in order to send it . Anyone dealt with this? I would appreciate any help on this!
Heyyy, really awesome tutorials, definitely worth the effort, I was wondering if you can do pdf download onto the Django CRM tutorial, that would help alot!!! 😀
Excellent video, thank you so much Dennis! What about the diacritics? When the HTML contains letters like ă,î,ș,ț,â I get this error: UnicodeEncodeError 'latin-1' codec can't encode characters in position 405-409: ordinal not in range(256)
Did you find a solution? Actually, there are no problems with images when working on Windos, when I set up the project to run on Ubuntu, there is no image in the pdf file, although images appear on other pages.
Thanks for overview! My actual css styles doesn't work despite i provide a function for 'link_callback' variable to define the path of css file which used in my template. Also i check this path and it's correct. But css styles doesn't work.
I want to create a multipage pdf with paragraph and table content. And the table may expand in rows thus making it multiple pages or a single page. I while doing this i also want to preserve the Header and Footer (both images). And I also want the liberty to be able to change the paper size. Default paper size = A4. Django + React
Do you have course in udemy or anywhere?? I’d for sure attend ! And please could you render to pdf on the asset management app crush course, it will help a ton!!! I really hope you see this comment 🥺
Need help please ... I did the same but unfortunately for it's printing scramble characters for Arabic characters ... Any one can help how to write Arabic characters to pdf.
Hi Bro. Awesome tutorials.! Could you please help to confirm is there way to open PDF file from desktop and extract specified field for 'n' number of PDF files in the folder via Django. I am trying to develop web app which can do PDF automation.
Hi thanks a nice video it helped me a lot. I want to get the template with its bootstrap designing but with this code its not working. another issue is the static images which are not loading. waiting for Response.
for images. first of all you need to install pillow. secondly you need to do some setting inside the urls.py file which you can easily find on stackoverflow. just type static images not loading in django.
Hi Dennis - great video, thanks for doing it. I tried using this code within an admin action to create pdfs 'with selected items..' but I can only download a pdf for the last item in the action's queryset. Have you any plans, or would you be interested, in doing a video for creating and downloading pdfs from an admin action?
Don't forget to check out my Complete Django course! dub.sh/NvGboTI
Love your tutorials! Easy and very well explained
Thank you! Glad you found them helpful :)
I think you are the best django teacher
Is there a newer/better tool than xhtml2pdf, cause it seems like this tool doesn't support lots of css features and is only made for very simple html pages. But for me it doesn't work with elements that have posiotion absolute or even a clip-path. Do you know a tool, that supports all css?
the problem is rendering images ( tried many different libraries but there is always an issue )
Any resolve?
First of all , Thanks. i have issue. i cannot view "ş, ğ, ı, İ etc." can you help me?
Sorunu çözebildin mi? aynı dertten muzdaribim....
Thanks exactly what I am looking for.
brother thank you very much. I have a question that if i want to insert the data into invoice from database then how to code views function so that i can insert into invoice html file. could you please help me.
Did you find any ways to do it sir???
First query the database for the data you want, and then create a dictionary from it. The new dictionary will replace the static data dictionary that he has. Let me me know if you need help with that.
@@wethepeopleofghana8441 i have a similar problem. I need a dynamic dictionary that depends the user selection. My problem is when going from one url[index] to another[function print], the variables change their value to None. you can help me pls?
@@alvarobencosme5348 Yes, but I will have to see that part of your code. You can send me an email, aduemmanuelk21@gmail.com.
@@alvarobencosme5348 I will be able to help, but I will have to see that part of your code. You can send me an email, aduemmanuelk21@gmail.com
Dennis, may you please make a video on "csv files". Uploading and exporting them from a template with a table. Thanks!
It might be a bit before I get to that but I'll add it to my recommendations list. Thanks for the input :)
Yes please!
how do i write the data if its on my database.?
Html won't use external css render to pdf?
Any fix available?
same issue, i provide a function for link_callback variable to perform the path of css file to an absolute path at my host machine, but css doesn't work.
Hey dennis, actually i was working on an e-commerce website as a project. Then i came across the feature to render invoice to pdf and send it through e-mail. And your video helped alot. So Thank you💐. Also, i wanted your little help. Actually i am unable to print product(s) details on pdf, it says "you are passing more than 1 object" when there is more than 1 product. It's the "orderItem" model, and it is based on your e-commerce website video. Will you please help me with this?
what should be on html template to render data in clean & in order
How to display model object images in pdf?
You need to get the user image.path
some syntax error, downloaded pdf has ' ' attached to it.
The view button works perfectly for me but the download button is downloading a file of an unknown type. Thanks for the video :)
I have a problem. I was following this but this cannot display another language like Thai or Lao.
Thank you for sharing your knowledge! It was very useful for me.
Glad the video helped! Thanks for your feedback :)
That works OK!! Thanks Dennis. I cant figure out how to attach the generated pdf to an email in order to send it . Anyone dealt with this? I would appreciate any help on this!
Can you please advise what I should do to render cyrillic (russian) font on pdf page?
Сергей, добрый день! Получилось ли решить вопрос с поддержкой кириллицы?
Heyyy, really awesome tutorials, definitely worth the effort, I was wondering if you can do pdf download onto the Django CRM tutorial, that would help alot!!! 😀
Excellent video, thank you so much Dennis!
What about the diacritics? When the HTML contains letters like ă,î,ș,ț,â I get this error:
UnicodeEncodeError
'latin-1' codec can't encode characters in position 405-409: ordinal not in range(256)
What if we use pagination, is it real to print all the pages on pdf?
Thank you Sir. It's work.
Excellent work !!! Need one help.
test
Logo File is not able to see in the pdf, created a issue in git
Did you find a solution? Actually, there are no problems with images when working on Windos, when I set up the project to run on Ubuntu, there is no image in the pdf file, although images appear on other pages.
@@zekict not so far
Thanks for overview! My actual css styles doesn't work despite i provide a function for 'link_callback' variable to define the path of css file which used in my template. Also i check this path and it's correct. But css styles doesn't work.
I want to create a multipage pdf with paragraph and table content. And the table may expand in rows thus making it multiple pages or a single page. I while doing this i also want to preserve the Header and Footer (both images). And I also want the liberty to be able to change the paper size. Default paper size = A4.
Django + React
I'm looking to do that also, did u got any solution for that?
Hi, how can you render an image in the pdf?
Do you have course in udemy or anywhere?? I’d for sure attend ! And please could you render to pdf on the asset management app crush course, it will help a ton!!! I really hope you see this comment 🥺
is there something like html2image or render_to_image, i want to render template to a image file and send via telegram api
Getting "unknown encoding: ISO-8859-1". PLZ HELP
I want to save thi pdf in database how to do this
I wanna do this too
Can you please add requirements.txt to your django projects?
Need help please ... I did the same but unfortunately for it's printing scramble characters for Arabic characters ... Any one can help how to write Arabic characters to pdf.
i am getting this error
ModuleNotFoundError: No module named 'xhtml2pdf'
even after installing
not sure if its the issue but have you added it to your settings file?
Please share the HTML template for the pdf as well
Hi Bro. Awesome tutorials.! Could you please help to confirm is there way to open PDF file from desktop and extract specified field for 'n' number of PDF files in the folder via Django. I am trying to develop web app which can do PDF automation.
Спасибо. Есть ли возможность увидеть это на русском?
Have u got solution? Plz share
Boss, how can i generate date wise sales report ?
@Dennis, I am getting below error while calling render_to_pdf function : Please help
Request Method: GET
Request URL: 127.0.0.1:8000/pdf_view/
Django Version: 2.1
Exception Type: gaierror
Exception Value:
[Errno 11001] getaddrinfo failed
class ViewPDF(View):
def get(self, request, *args, **kwargs):
keypoints = KeyPoints.objects.exclude(KP_Flag='False')
tick_list = Tickets.objects.exclude(Tick_Flag='False')
monthlyActs = Monthly.objects.all().order_by('Remark')
out_list = Outages.objects.exclude(Outage_Flag='False')
# cr_list = CR.objects.all().order_by('CR_StartTime')
cr_list = CR.objects.exclude(CR_Flag='False').order_by('CR_StartTime')
context = {
'tick_list': tick_list,
'keypoints': keypoints,
'monthlyActs': monthlyActs,
'out_list': out_list,
'cr_list': cr_list,
}
pdf = render_to_pdf(
'Consolidated/consolidated.html', context)
return HttpResponse(pdf, content_type='application/pdf')
and in consolidated.html I m printing values as below for each dictionary :
{% for KP in context.keypoints %}
{{ KP.KP_Added_On }}
{{ KP.Added_By }}
{{ KP.KP_Description }}
{% endfor %}
Hi thanks a nice video it helped me a lot.
I want to get the template with its bootstrap designing but with this code its not working.
another issue is the static images which are not loading.
waiting for Response.
for images. first of all you need to install pillow. secondly you need to do some setting inside the urls.py file which you can easily find on stackoverflow. just type static images not loading in django.
it's not working in any other language!!
Thanks Alot Brother
It is not able to render Js charts
You can use var jp64 to download image (chart)
does not support other languages I got something like Date: ■■■■■■ ■■■■
Amount: ■■■■■■■ ■■■
Bill to: ■■■■■■■ ■■■■■■■ ■■■ ■■■ any help please
Have u got solution? Plz share
Hi Dennis - great video, thanks for doing it. I tried using this code within an admin action to create pdfs 'with selected items..' but I can only download a pdf for the last item in the action's queryset. Have you any plans, or would you be interested, in doing a video for creating and downloading pdfs from an admin action?
Thank you for sharing
My pleasure :)
I have problems with Arabic fonts
Have u got solution? Plz share
Спасибо бро
how to show Arabic text ti pdf
did you find the solution?
Have u got solution? Plz share
perfect
pdf is corrupted
men por que hacen esto así mucho código engorroso toca ir a buscar una manera mejor mas corta importan de todos lados y algunas cosas no las muestras
i'm lovely fun of you bro you
Did you every actually make the HTML to PDF video u mentioned at the end??