DynaDPF Questions

Can anyone help me with these simple questions:

Regarding the code segment below:

  1. What other options are there apart from kfsItalic?

Regarding the code segment below:

  1. How do I get the text area to be 40 px from the left, and 180 px from the top?
  2. What other options are there apart from ktajustify?
call pdf.writeFText(pdf.ktajustify, Window1.TextArea1.text)

The documentation is so humongous, I can never find the information I require :frowning:

Any help appreciated.
Thank you all in advance.

usual sort of things
kfsRegular , kfsBold

just type pdf.kf and you should see the options.
The constants are bit patterns: you can combine them using + or bitwise OR

The MBS docs are very dry (its basically just a wrapper) , and you get more hints by looking in the actual DynaPDF docs.


Find what you need there, and then search the MBS options from the pdf object to use them.

Thanks Jeff.

I looked at the DynaPDF documentation, but none of it was actual Xojo code (obviously), so it didn’t really make any sense :frowning:

I tried to add in the coordinates to move my text area text down the page, but then it all got written to a single line in the pdf (as opposed to 20 lines of text that was in the text area)?

Well, you can ask me of course. Documentation improves as I include answers to questions there if possible.

The documentation actually lists all the constants for font styles:

Constant Value Description
kfsBlack &h38400000
kfsBold &h2BC00000 The old constant 2 is still supported to preserve backward compatibility
kfsCondensed &h00000300
kfsDemiBold &h25800000
kfsExpanded &h00000700
kfsExtraBold &h32000000
kfsExtraCondensed &h00000200
kfsExtraExpanded &h00000800
kfsExtraLight &h0C800000
kfsItalic 1
kfsLight &h12C00000
kfsMedium &h1F400000
kfsNone 0
kfsNormal &h00000500
kfsRegular &h19000000 Same as fsNone
kfsSemiCondensed &h00000400
kfsSemiExpanded &h00000600
kfsStriked 8
kfsThin &h06400000
kfsUltraBlack &h3E800000
kfsUltraCondensed &h00000100
kfsUltraExpanded &h00000900
kfsUnderlined 4
kfsVerticalMode &h00000010 Not considered at this time (v2.5)

you can put in kfsBold for example for bold.

For positioning with WriteFTextEx, you have two options.

  1. Call SetTextRect before.
  2. Call WriteFTextEx with passing the rectangle.

method WriteFTextEx(PosX as double, PosY as double, Width as double, Height as double, Align as integer, aText as string) as Boolean

Please note that you get a PageBreak event in case the box is full. Without such an event with your code, you get a new page automatically. In this event, you can switch to different rectangle to continue text on same page or start a new page.

See the Formatting Text example projects.

if you try autocomplete after kta, you find all the options:

Constant Value
ktaCenter 1
ktaJustify 3
ktaLeft 0
ktaRight 2

Thank you for that Christian - much appreciated!
I will try your last advice with regards to positioning a text area’s text.