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 16.4 ('Mojave')
Instant purchase and download via GumRoad!

FEATURE

Scripting PDFs

Combining stock scripting and PDF generation

Issue: 16.4 (July/August 2018)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: > 12Article Length (in bytes): 64,426
Starting Page Number: pt
Article Number: 16402
Resource File(s):

Download Icon project16402.zip Updated: 2018-07-02 22:38:56

Related Link(s): None

Excerpt of article text...

In xDev 16.2 I wrote two different articles, one on scripting stock prices (the StockScripter app) and one on using the DocVerter web service to convert Markdown and HTML files to PDF. Today I've decided to merge the two into StockScripter 2.0!

You may remember I suggested this in my original article: I liked the idea of being able to generate stock reports as PDFs, so the natural evolution of the article is to expand the scripting language to support PDF generation.

As usual, I like to do things in multiple ways, so I'm going to present two methods of making PDFs: the simple way and the more complicated way. The first method requires minimal scripting—it's just a boolean flag that tells StockScripter to generate a PDF instead of writing the results to PortfolioWindow (see Figure 1).

The second way is a comprehensive addition to the StockScripter scripting language. I've pulled some parts from another project I wrote to add full picture drawing support. While this complicates the scripting, it gives you considerable power—anything you draw you can turn into a PDF!

Granted, today's demo just touches the surface of what's possible—but I hope you can see the future and adapt this kind of technology for your own projects. The capabilities of XojoScript are incredible and for certain needs, indispensable.

So let's get started!

...End of Excerpt. Please purchase the magazine to read the full article.