Article Preview
Buy Now
FEATURE
Drawing PDFs
Draw in a PDF like in a Graphics element
Issue: 18.2 (March/April 2020)
Author: Stefanie Juchmes
Author Bio: Stefanie studied computer science at the university in Bonn. She came in touch with Xojo due to the work of her brother-in-law and got a junior developer position in early 2019 at Monkeybread Software.
Article Description: No description available.
Article Length (in bytes): 9,847
Starting Page Number: 66
Article Number: 18206
Resource File(s):
project18206.zip Updated: 2020-03-02 10:36:28
Related Link(s): None
Excerpt of article text...
The MBS Xojo DynaPDF plugin offers in version 19.2 the possibility to draw in a PDF like in a Canvas control. We want to show you how to do this. In this example you can write a letter by choosing your salutation, the name of the addressee, the content of the letter, form of greetings, signature, select some of the graphics elements, and add them to the letter (see Figure 1).
For the selection of the graphical elements, we use checkboxes. For the choice of the solutions and the greetings, we use popupMenus with predetermined values (see Figure 2). The name of the addressee and our signature can be entered in textfields. The content of a letter is written in a Text Area. We see the preview on the left side in a
canvas
. We have three buttons. One refreshes the preview, one creates the PDF and the last calls the printing dialog to print the text.Before the DynaPDF Plugin 19.2, you need for every button a detailed method which does the same in three different ways. Now you can write one script, that you can call with each button. This saves extra work and avoids problems. We write a method with name
draw
and give her the parameterg as graphics
.At first we test which checkboxes are clicked and write the belonging code. We start with the checkbox
Fill Rectangle
:
If FillRec.Value = True Then
...End of Excerpt. Please purchase the magazine to read the full article.