Home Screenshots Download Help Forum Contact


News & Events

  • 17 may 2010
    release date of the class for VB6
  • 10 may 2010
    release date of PHP class
  • 10 May 2010
    application release date

coming soon ...

  • barcodes
    release date of the class for VB6
  • charts
    application release date
  • new classes for other PHP libraries and for other programming languages
  • fonts and encodings
    new fonts and all encoding types
  • more objects
  • image efects and editing
  • Visual2PDF designer for Linux

 

Visual2PDF - HELP

Visual2PDF - HELP



We will put more explanations and examples on the forum


Design

Installation and requirements
First, you must download the application setup from http://wwww.visual2pdf.com, run the setup and follow the instructions until you reach the finish.
It has no special requirements, just a computer with Microsoft Windows installed, at least Windows 98.
Description
Visual2PDF is a very usefull tool for all the programmers and helps them to create, in a visual environment, document forms and reports that can be used in any programming language to generate dynamically PDF forms and reports. The output files are XML files with .XPF extension.
We are not only developers of this application, we are using it to generate invoices, bill forms, payment orders for all the banks from Romania and many other documents for accountancy that are used by our customers. With this application we can make very fast and easy any type of customized documents for our customers. The documents which are created, can be used to print on pre-printed paper forms in absolute positions or to be printed on blank A4 pages. At the begining, we are providing classes to interpret generated files and to be used with TCPDF library. In short time we will provide classes for all PDF libraries and for all main programing languages. You have only to copy the generated file on your website, after that, when your application need to generate the PF document, you only need to send the file name and the fields which will be filled. You have also many posibilities to change the any settings before the pdf is generated. You can make complex forms in only few minutes.
Main features
As you will see, there are available many options for drawing and editing. You can draw lines, texts, labels, tables, rectangles, ellipses, circles, images, you can put a background image of the form, you can fill background of the objects with any color, you can select the font, font color, font size, italic, bold, underline, you can choose the border type and thickeness, you can copy, cut and pasete objects, resize, move and many other options.
Future options
Besides the classes for all the environments, we want to add more ooptions and more objects which can be inserted in a form. So, we want to introduce many types of charts, layers, groups, many other objects which helps to create faster the forms.
Demo and activation
The application can be tested in demo with all the options. The restriction for demo is that you cannot save documents which are having more than 10 objects or which are containing tables with more than 3 columns.
To activate the application you have to purchase a license, after the payment confirmation, in few seconds you will receive an e-mail message with the license number. You enter the license number, email address, company name, contact person, country in the registration form in the application, click Activate and in one second, the application is activated. Very simple and very fast.

How to design the documents?

As you will see, the application interface is very simple and the design options are very common to other graphical design applications.
The bellow image is the main window with an document oppened. It is an invoice and a bill.
Main window with an opened document

Draw objects: To draw objects on the form document you can choose an object from the second toolbar which you can see in the image bellow.

  • this button is not for design, it will show the list of the documents as you can see in the first image above
  • and - are doing the same thing - drawing texts on the form
  • draw a table
  • is opening an image to draw on the form. You can draw the same image as much as you want on the form and with the dimensions that you want for each. To draw another iamage objects with the loaded image use
  • - draw rectangle, line and circle or ellipse
  • -locks the objects on vertical and/or horizontal. This buttons are usefull if you have to click some objects and you don't want to move the by mistake. It also can be used to align objects by locking horizontal movement or the vertical movement. Also, you can lock vertical when you draw an horizontal line.
  • - you can change the zoom to work better on details or to see the entire document.

Format objects: You can format objects from the third toolbar and from the object properties window.

- change the font name, font size, bold, italic underline for selected objects.

- left square- change the font color or the border color, right square -change the background color.

- align the texts in text objects, label objects or in table cell. This apply to the selected objects

- change the background color, background type (Transparent, Solid, Diagonal, ...), border style and border thickeness of an object: rectangle, circle, table cells. It applies even for texts and labels but only if "grafic" property is checked. This applies for all selected objects.

Object's properties:

By right click on an object the following popup menu will appear.

>

Send to back - send an object behind all others
Send backward - send an object a step behind
Bring to front - bring an object in front of all others
Bring forward - bring an object a step in the front

Text and Label

  • Name: the name of the object. If you give a specific name to the object you can access it by name, in classes that generates the PDF files, and change any property
  • Left - left position in mm
  • Top - top position in mm
  • Widh - object's width in mm
  • Height- object's height in mm
  • Text - the printed text. This can be changed form rendering class
  • Default text - text which is displayed if the class receives an empty string as text
  • Source - a name of the field data that is expected to be received. Eg. if you put as source "name", then you can send to the class a string to be filled in like $source['name']='My name'; , in this way you are transmiting the fields to the PDF
  • fixed number of chars - if this value is greater than zero then the class will will divide the width at the number of chars and the chars will be at equal distances, one from another
  • Separate - if separate is checked then the characters will be separated by lines. If Graphic is checked, the result will be this . It has efect only if fixed number of chars is greater than zero.
  • Substrstart and Substrend will take a substring from the string, begining with the Substr start and ending with Substr end. First char position is 1.
  • Fill blanks with char - if the lenght of the string is smaller than fixed number of chars than the rest of the chars will be filled at left or at right, depending on Fill blanks at with the char entered in Char.
  • Padding - distance of the text from the borders. The values are in pixels.
  • Indent - indentation of the first line of the text
  • Diacritics - if it is not checked, all the characters with accents will be replaced
  • Clear dots, commas, spaces- clear all the dots, commas, spaces from the text
  • Uppercase, Lowercase - transform the string to lowercase or uppercase
  • Print zero - prints zero if the received string is empty
  • Printable - if this is not checked then the field will be visible on the screen but will not be printed
  • Graphic - if this is checked then you will be able to put a background color and a border
  • ID is read only and can be used to acces the object from the class to modify the properties

Table

  • Name: the name of the object. If you give a specific name to the object you can access it by name, in classes that generates the PDF files, and change any property
  • Left - left position in mm
  • Top - top position in mm
  • Widh - object's width in mm
  • Height- object's height in mm
  • Max height - the maximum height of the table
  • Cell spacing - not used for the momment
  • Cell padding - padding inside cels lik in HTML
  • Repeat header on each page - for multipage reports if you want the header to be repeted
  • Printable - if this is not checked then the field will be visible on the screen but will not be printed
  • ID is read only and can be used to acces the object from the class to modify the properties

Cell

  • Name: the name of the object. If you give a specific name to the object you can access it by name, in classes that generates the PDF files, and change any property
  • Left - left position in mm
  • Top - top position in mm
  • Widh - object's width in mm
  • Height- object's height in mm
  • Text - the printed text. This can be changed form rendering class
  • Default text - text which is displayed if the class receives an empty string as text
  • Source - a name of the field data that is expected to be received. Eg. if you put as source "name", then you can send to the class a string to be filled in like $tablesource['name']['company'][]='My name'; , in this way you are transmiting the fields to the PDF
  • Padding - distance of the text from the borders. The values are in pixels. It has effect only in Visual2PDF not in the PDF, use insead the Cellpadding property from the table object that applies for all the cells
  • Min height - the minimum height of the cell
  • Diacritics, Uppercase, Lowercase, Zero - see the Text and Label object
  • ID is read only and can be used to acces the object from the class to modify the properties

Row

This window appears only when you click Select Row from the popup menu.

  • Name: the name of the object. If you give a specific name to the object you can access it by name, in classes that generates the PDF files, and change any property
  • Row- read only row number
  • Min Height - minimum height of the row in mm
  • Header, Body, Footer - set the row as header or footer or body. The class process the header first then the body and add as many rows as needed and after that process the footer. All the cells can be accesed and the properties can be changed from the class.

Image

  • Name: the name of the object. If you give a specific name to the object you can access it by name, in classes that generates the PDF files, and change any property
  • Path - hte path for the image file. The class will use only the filename, so you must copy all images in the same folder with the document
  • Left - left position in mm
  • Top - top position in mm
  • Widh - object's width in mm
  • Height- object's height in mm
  • Keep proportions - if the image is resized it will keep the proportions
  • Printable - if this is not checked then the field will be visible on the screen but will not be printed
  • ID is read only and can be used to acces the object from the class to modify the properties

Rectangle

  • Name: the name of the object. If you give a specific name to the object you can access it by name, in classes that generates the PDF files, and change any property
  • Left - left position in mm
  • Top - top position in mm
  • Widh - object's width in mm
  • Height- object's height in mm
  • Printable - if this is not checked then the field will be visible on the screen but will not be printed
  • ID is read only and can be used to acces the object from the class to modify the properties

Ellipse

  • Name: the name of the object. If you give a specific name to the object you can access it by name, in classes that generates the PDF files, and change any property
  • Left - left position in mm
  • Top - top position in mm
  • Widh - object's width in mm
  • Height- object's height in mm
  • Keep proportions - if the image is resized it will keep the proportions
  • Printable - if this is not checked then the field will be visible on the screen but will not be printed
  • ID is read only and can be used to acces the object from the class to modify the properties

Line

  • Name: the name of the object. If you give a specific name to the object you can access it by name, in classes that generates the PDF files, and change any property
  • X1 - left position in mm
  • X2 - right position in mm
  • Y1 - top position mm
  • Y2- bottom position in mm
  • Printable - if this is not checked then the field will be visible on the screen but will not be printed
  • ID is read only and can be used to acces the object from the class to modify the properties

Document Properties:

  • Name: the name of the object. If you give a specific name to the object you can access it by name, in classes that generates the PDF files, and change any property
  • Path - read only - the path where the document is saved
  • Width - is the width of the form in mm. If you will print on preprinted forms it is important to give a accurate value
  • Height - the height of the form in mm. If you want to print on pre-printed form of if you want to print more than one form on a page, the height of the form is veri important
  • Portrait, Landscape - format of the form that will be printed
  • Forms/page - the number of the forms which are printed on a page
  • Distance between forms in mm.
  • Color/Monochrome - the form is printed color or monochrome
  • Margins - you can set the margins and all the objects will move accordingly, even the background image
  • Adjust X, Adjust Y are used to move the form tot the left-right or to the top-bottom only for the printer
  • Background image is a fixed imagege which will be painted on the form
  • Path - is the path for the background image, the background image has to be in the same folder with the document when you put the document on the site, the class will take only the filename and wil search it in the document folder
  • Printable - if this is not checked then the field will be visible on the screen but will not be printed
  • ID is read only and can be used to acces the object from the class to modify the properties

 

Editing

You can unlimited Undo and Redo, Copy, Cut, Paste object or selected objects, delete object or selected objects.

 

Press Slect button to select, resize, move objects. When you want to edit the objects this button have to be pressed. The seond button in the image is for properties, if this button is pressed then properties windows will appear.

Shortcuts

  • CTRl + C -copy
  • CTRL+V -paste
  • CTRL+X -cut
  • CTRL+ Z - undo
  • CTRL+ R - redo
  • CTRL+A -select all
  • CTRL+D - unselect all
  • CTRL+N -new document
  • CTRL+ O - open document
  • CTRL+ S - save document
  • CTRL+ W - save as
  • DEL - delect selected objects. If you are in a table DEL will delete the texts in the cells.
  • CTRL+ arrows - move selected objects. Arrows without CTRL will move the page in the window.
  • CTRL+ P - print
  • F1 - Help
  • CTRL+ F1 - about
  • CTRL+ T - edit tabel
  • CTRL+ U - underline
  • CTRL+ B - bold
  • CTRL+ I -Italic
  • If you press CTRL+SHIFT when you want to select or to paste, the selover will be deactivated and you can paste even clicking on an object or you can start the selection even if you start from a point inside an object.
  • SHIFT - when you resize a cell, if you keep SHIFT pressed, the reseize will be only for the current column and the table width will be changed.
  • CTRL - if is pressed when you select an object the other selected object will reamin selected. If an object is selected and you click on it while CTRL is pressed then the object will be unselected.

 

Show objects - when you click show objects in the popup menu, the labels and text boxes will be shown as rectangles like in the below image.

Table options

There are many options for adding rows, adding columns, split cells, split columns, delete rows, delete columns, move rows, move columns, setting cell background color and ather usefull options which can be found by right clicking on a cell.

 

A report example you can see in the bellow image

How to use .xpf files to generate dynamic PDF files?

Class for generating dynamic PDF files using TCPDF classes in PHP

To generate a PDF file and to dynamically fill the fields, you have to use showpdf.php and visual2pdf.php

showpdf.php is an example of how to declare, transmit the texts, change settings and generate PDF

 

<?php
//the path to TCPDF classes - we recomend to have all the time the latest TCPDF release
require_once('../../tcpdf/config/lang/eng.php');
require_once('../../tcpdf/tcpdf.php');
//the path to the class that reads XPF and generates PDF
require_once('visual2pdf.php');

// create new PDF document
$pdf = new visual2pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

//properties of the PDF
$pdf->SetCreator('NB-GENERALSOFT SRL');
$pdf->SetAuthor('Narcis Bodea');
$pdf->SetTitle('Visual2PDF form');
$pdf->SetSubject('test');
$pdf->SetKeywords('VISUAL2PDF, PDF, example, test, guide');
$pdf->SetDisplayMode ('fullpage');
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

$pdf->SetAutoPageBreak(false, PDF_MARGIN_BOTTOM); //if the form is multipage then set TRUE, otherwise it is better to set false

//load the XPF document, in this example it's path is transmited with $_GET
$pdf->loadForm($_GET['f']);

//$pdf->perpage=2; //setting perpage you can overide the number of the forms on the page

//setting the margins for the form, you will move entire content to the (positive values) left, top, (negative values) right, bottom
//the margin units are in mm

$pdf->topmargin=0;
$pdf->leftmargin=0;

$pdf->adjustX=0; // moves the entire content to the left or to the right, it is added to existing margins, you can let the user to set this parameter to make the text to be printed on absolute positions on a pre-printed paper form
$pdf->adjustY=0; // moves the entire content to the top or to the bottom, it is added to existing margins, you can let the user to set this parameter to make the text to be printed on absolute positions on a pre-printed paper form

//$pdf->changeLayout('L'); //you can change the layout of the form to landscape (L) or portrait (P) , the default value is that which is set in the design

//this is an example of how to set the printer alignament for a laser printer wich load the paper from the center

$pdf->portrait_vertical_align="top";
$pdf->portrait_horizontal_align="center";
$pdf->landscape_vertical_align="center";
$pdf->landscape_horizontal_align="right";

//$pdf->setBackground('printable',true); //you can override the setting for printing background image,

//populate the sources
//for the text obects with source property set, the text will be replaced with tyhe string that you set for each source

$pdf->sources['Numar']='1234'; // 'Numar' is the source name and '1234' is the value which will be filled
$pdf->sources['Suma in cifre']='150.000,56';

//to populate a body of a table
// you can choose which row will be added to the body
//in the bellow example, we have 2 rows, one for odd (impar) and one for even (par), as you can see
// we use one row for even rows and other row for odd rows, they have different backgrounds and fonts
// the body rows must be created in design and you can chose by it's name which row will be generated and filled with sources
// word Factura is the name of the table

for ($i=1;$i<70;$i++) {
if ($i%2!=0) {
$pdf->tablesources['Factura'][$i]['rowname']='impar';
}
else{
$pdf->tablesources['Factura'][$i]['rowname']='par';
}
$pdf->tablesources['Factura'][$i]['nrcrt']=$i;
$pdf->tablesources['Factura'][$i]['denumire']="Product number {$i}";
$pdf->tablesources['Factura'][$i]['um']="buc";
$pdf->tablesources['Factura'][$i]['pu']="100";
$pdf->tablesources['Factura'][$i]['tva']="5";
$pdf->tablesources['Factura'][$i]['valoare']="19";
}
//here is a line example that fills a cell on a footer row, the cells on header and footer rows will be filled like in the line bellow
$pdf->tablesources['Factura']['total']='20000 RON';

//set a property of an object retrieved by it's name, you can change any attribute of any object using it's name to identify, if there are many objects with the same name -> the attribute will be changed for all objects
$pdf->setObjectByName('test','text','blabla');

//here we set some hidden objects to be shown, hidden attribute is very usefull if you want to display and print an canceled invoice for example, you change the hidden attribute when the invoice is canceled. Example: you draw to diagonale lines on the invoice and put a big text on the center with text CANCELED, you give to all objects the name canceled and attribute hidden to true, when an user cancel an invoice you can set $pdf->setObjectByName('canceled','hidden','0');


$pdf->setObjectByName('anulata','hidden','0');
$pdf->setObjectByName('chitantaanulata','hidden','0');

//if you encounter TCPDF ERROR: Some data has already been output, can't send PDF file you have to set obclean to TRUE, to clean the headers
$pdf->obclean=false;

//if you want to see the sources of the texts in the annotations, set this to TRUE
$pdf->showannotations=false;
//micfont represents a value which will reduce the fonts sizes
$pdf->micfont=1;
//populate will pupulate the texts with sources
$pdf->populate();
//this generates the PDF, if you call with a TRUE parameter ($pdf->WriteForm(true)), you will see the name of the sources for any text field, displayed with red color
$pdf->WriteForm();
// ---------------------------------------------------------

?>

 

Copyright NB-GENERALSOFT S.R.L. | Email: contact@visual2pdf.com | Tel: +40263210265 | Fax: +40263219063 | | Tags: PHP PDF VB6 TCPDF GENERATE DESIGN