03-04-2025, 04:13 PM
Wow. Thanks for all the work that went into this.
I couldn't manage to get an image to load on the page but the text manipulation is working fine. It was easy to create some subroutines to generate a new pdf. Thanks again.
I couldn't manage to get an image to load on the page but the text manipulation is working fine. It was easy to create some subroutines to generate a new pdf. Thanks again.
Code: (Select All)
'some simple pdf text experimenting
'$Include:'pdfGen.bi'
'Always Add page, you need a page to work on
pdfAddPage
'Always Load a Font, "F1" is it Identifier
'Only the built in fonts work, for now
pdfLoadFont "F1", PDF_FONT_TIMES_ROMAN
'Begin a Text Block, only do text stuff here
pdfBeginText
'Set font "F1" to size 36
pdfSetFontSize "F1", 36
'End the text block. Always end the text block!
Dim atext$(9)
a$ = "ABC 1"
For x = 1 To 9
atext$(x) = a$
If x > 1 Then atext$(x) = atext$(x - 1) + Str$(x)
Next x
pat 10, 360, 40, "XYZ123"
pagearray 10, 10, 28, 30, atext$()
For x = 10 To 550 Step 110
pagearray x, 400, 12, 14, atext$()
Next x
pat 300, 760, 12, "Page 1"
pdfAddPage
pagearray 50, 40, 36, 40, atext$()
pat 300, 760, 12, "Page 2"
'Generate The PDF
pdfGen "pdfGenTest.pdf"
System
'$Include:'pdfGen.bm'
Sub pat (x, y, typesize, txt$)
'setup to print at coordinates from top left corner
'x =0 to 600 y= 0 to 780
pdfSetFontSize "F1", typesize
pdfSetPosition x, 780 - y
pdfAddText txt$
'End the text block. Always end the text block!
pdfEndText
End Sub
Sub pagearray (x, y, typesize, leading, txtarray$())
tlines = UBound(txtarray$)
pdfSetFontSize "F1", typesize
XPos = x
YPos = y
For t = 1 To tlines
pat XPos, YPos, typesize, txtarray$(t)
YPos = YPos + leading
Next t
End Sub