4GL Developer’s corner

Select your development environment below…

Visual Studio        Visual Basic

Add the vpxPrint.vb class in the project and

Dim vpxPrint As New _xPrint

When entering lines of code, the word vpxPrint. causes the display of a contextual menu suggesting the available functions of the class.

    Delphi

Include “vpPrint.pas” in the “uses” section of the project

When entering lines of code, the word vpxPrint. causes the display of a contextual menu suggesting the available functions.

Visual Studio        Visual C#

Include the vpxPrint.cs class in the project

When entering lines of code, the word vpxPrint. causes the display of a contextual menu suggesting the available functions.

from ctypes import*

########################### Create the output file #########################################
f = open(‘C:/temp/python.xpr’, ‘w’)                # output file
f.write(‘Hello world!’)
f.close()

########################### Different ways to call vpxPrint ###################################

1.import subprocess:

subprocess.call([“c:/windows/system32/vpxcall”, ‘C:/temp/python.xpr’])

2. call vpxCall:

param = ‘C:/temp/python.xpr’
arg=[“vpxCall”, param]    # optional  , “-LOG”
subprocess.Popen(arg)

3. call the dll:

xprint = cdll.LoadLibrary(“xprint.dll”)
xprint.printFile(‘C:/temp/python.xpr’)

    Progress OpenEdge

Include xPrint.i in the project

Visual Studio

Visual Studio C++

C++ Builder

C++ Builder

… allow vpxPrint::printFile, pageCount and other methods

The command file

The data and commands are inserted in a text file, with ANSI or UNICODE encoding, usually with a .xpr suffix.

The commands and options are specified in tags surrounded by < and >, such as in an HTML file. But fear not, their format is much simpler and the commands are concise and powerful.

Example:

<PREVIEW><PDF-OUTPUT=C:/Temp/Hello.pdf>Hello World!

… is a seed file that previews “Hello World!” on the screen and also creates a PDF file called C:\temp\hello.pdf with the same content.

Another example:

<PRINT=NO><R10><C10><ANGLE=45>Hello World!

<MAILTO=j.doe@gmail.com,clint@outlook.fr CC=support@4GL.fr>

<MAILRECEIPT><MAILSUBJECT=For your info>

<MAILBODY=Hi John, find the requested info and the Excel planning…>

<MAILATTACH=C:/temp/Planning.xlsx>

<SENDMAIL=PDF,NO-DIALOG>

… builds silently (<PRINT=NO> and no preview) “Hello World!” from row 10 column 10 but oriented 45°, silently sends an email (NO-DIALOG) with this document in PDF format and the schedule (Planning.xlsx) attached. It also asks for a receipt…

How many lines of code should you write for this without vpxPrint? How long would it take you?

But more than this, a multitude of situations are possible, printing of course but also archiving (multi-page TIF files), sending marketing emails, creating PDF files for remote printing …
Images, figures, lines, bar codes, draw on your canvas, manage Excel or Powerpoint, the limit is your imagination!

vpxPrint allows you to print local files, as well as files from the Internet or an intranet, whether they are hosted on a web server or an FTP server.

 

Ready To Get Started?