Re: [Module] pbPDF-Module
Posted: Sun Nov 19, 2023 1:11 pm
Thanks to normeus and Little_man for directing me, and many thanks to Thorsten1867 for creating such a great PDF library.
All varieties of the Lato fonts have Polish characters. I made a mistake in the previous post because I marked the font access incorrectly. It is best to place fonts in the same directory as pbPDFModule.pbi, and place my example where the example files are located, in the Examples directory. All fonts Lato also covers the Russian language (I studied Russian in secondary and high school) and the language of my wonderful Slovak neighbors (I live 20 km from the border).
In my opinion, the Lato font is probably the best font for content created in PDF. Lato can be included in commercial applications freely.
All varieties of the Lato fonts have Polish characters. I made a mistake in the previous post because I marked the font access incorrectly. It is best to place fonts in the same directory as pbPDFModule.pbi, and place my example where the example files are located, in the Examples directory. All fonts Lato also covers the Russian language (I studied Russian in secondary and high school) and the language of my wonderful Slovak neighbors (I live 20 km from the border).
In my opinion, the Lato font is probably the best font for content created in PDF. Lato can be included in commercial applications freely.
Code: Select all
XIncludeFile "..\pbPDFModule.pbi"
Define File$="multilingual_lato_fonts.pdf"
#PDF = 1
; Create an instance of PDF
If PDF::Create(#PDF)
; Always add a page to create a PDF or you'll get an error
; Page size and orientation is optional, I like to add it because you can have multiple page sizes in a PDF
PDF::AddPage(#PDF,PDF::#Landscape,PDF::#format_letter)
;All Lato fonts has polish, russian, slovakian letters
; Lato-Italic.ttf
; Lato-Light.ttf
; Lato-LightItalic.ttf
; Lato-Medium.ttf
; Lato-MediumItalic.ttf
; Lato-Semibold.ttf
; Lato-SemiboldItalic.ttf
; Lato-Thin.ttf
; Lato-HeavyItalic.ttf
; Lato-ThinItalic.ttf
; Lato-Regular.ttf
; Lato-Black.ttf
; Lato-BlackItalic.ttf
; Lato-Bold.ttf
; Lato-BoldItalic.ttf
; Lato-Hairline.ttf
; Lato-HairlineItalic.ttf
; Lato-Heavy.ttf
PDF::EMbedFont(#PDF, "..\Lato-Light.ttF","Lato","",PDF::#Unicode)
PDF::SetFont(#PDF, "Lato", "", 13)
PDF::PlaceText(#PDF, "In polish: Zażółć gęślą jaźń.", 10, 40)
PDF::PlaceText(#PDF, "What means: Yellow the goose self.", 10, 45)
PDF::EMbedFont(#PDF, "..\Lato-Semibold.ttf","Lato2","",PDF::#Unicode)
PDF::SetFont(#PDF, "Lato2", "", 12)
PDF::PlaceText(#PDF, "In slovac: Orly lietajú najvyššie a prečo sú také chytré.", 10, 60)
PDF::PlaceText(#PDF, "What means: Eagles fly the highest and why they are so smart.", 10, 65)
PDF::EMbedFont(#PDF, "..\Lato-BoldItalic.ttf","Lato3","",PDF::#Unicode)
PDF::SetFont(#PDF, "Lato3", "", 11)
PDF::PlaceText(#PDF, "In russian: Пусть всегда будет солнце, Пусть всегда будет небо, Пусть всегда будет мама, Пусть всегда буду я. ", 10, 80)
PDF::PlaceText(#PDF, "What means: May there always be the sun, May there always be the sky, May there always be my mum, May there always be me.", 10, 85)
PDF::Close(#PDF, File$)
EndIf
RunProgram(File$)