Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 18.2 ('Listbox Drawing')
Instant purchase and download via GumRoad!

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):

Download Icon 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 parameter g 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.