DEV Community

Discussion on: Printing on paper with Python 🖨️

Collapse
 
o_s_e3ae639c05a profile image
Okeke Stephen • Edited

Hi Kevin
Thank you for this wonderful post. Many I know how you created the template (.odt) file? i.e. the format. Some tutorials used @ @, others used < > as makers for the fields to be automatically updated. Which maker did you used in creating your template. Thanks.

Collapse
 
pa4kev profile image
Kevin van der Vleuten

Hello Okeke,
Thank you for your kind comment!

I created the .odt file with OpenOffice Writer.
openoffice.org/product/writer.html

There you can choose:
Insert > Fields > Other
Type: Placeholder
Format: Text
Placeholder: o.insert_here
Reference: o.insert_here

It creates the < > fields

For images, you will have to add frames to the .odt file.
Insert > Frame
go to tab "Options", set name to: image: o.my_image

Note that you will get errors if not all Placeholders are filled.

This documentation explains it well:
wiki.openoffice.org/wiki/Documenta...

I created a GitHub repository with example files you can view here:
github.com/PA4KEV/print-placard

Collapse
 
o_s_e3ae639c05a profile image
Okeke Stephen

Hi Kevin
Thank you!