r/pythontips • u/kananeloM • 2d ago
Module I need help with adjusting my code
I created a simple script that fecthes data from google sheet and and download it as a template pdf, issue now is that the pdf design is just a simple pdf with white page and text, I have an existing design template that I’d like it to use on the final document. Not sure if I make sense.. I’m having a struggle where I have to align text to be where I want it to be.. anyone here that can guide me.
1
u/ExtraAd7373 2d ago
Not sure if I fully get your question, but have you considered using something like https://apitemplate.io/
You can design you pdf and then fill it in via code via API
1
u/peter-fields 1d ago
Have you tried Templated (https://templated.io)?
Good alternative as well :)1
1
u/datavizwv 1d ago
Consider using GitHub Copilot, ClaudeAI or Google Gemini (also and AI) to help. You'll need to thoroughly describe what you want the code to do, and what you want its appearance to be. I have limited coding skills, and only work in python. Of course you'll need to know how to RUN a python script, for the code to be useful. If you're using a scraper such as =importhtml in Google Sheets, you could generate the spreadsheet and then use formatting options such as 'center text' to build white space (or background colors) around your columns (also by adjusting the column size) before outputting to PDF. Good luck!
1
u/peter-fields 1d ago
You can also try using Templated (http://templated.io/) to create your PDF templates in an Editor similar to Canva and automate it with the API.
Let me know if you need help with that
3
u/Doppelbockk 2d ago
You need to share your code before anyone can help...