Variables and methods of clsPDFCreator (FREE)

In this page you can found a list of then variables and the public metods of clsPDFCreator (only FREE version).Edit

Variables and properties

TITLE as String
Set the document’s title.

SCALEMODE as pdfScaleMode
Set the unit scale. Default, is 72 points per inch.    

PAPERSIZE as pdfPaperSize
Set the paper size. Default is A4 (21×29.7 cm).

PAPERWIDTH as Single
Set the width for user size paper.

PAPERHEIGHT as Single
Set the height for user size paper.

MARGIN as Single
Set the margins. Default is 0.

PAGES as Integer
Return the number of the current page.

ORIENTATION as pdfPrintOrientation
Set the orientation for the document. Default is portrait.

ENCODEASCII85 as Boolean
Set the ASCII85 encode for the image. Default è False.Edit

Methods

INITPDFFILE(Optional FileName As String) As String
Inizialize then PDF file. If filename is null, make a random file in the same directory and then return the full path.

CLOSEPDFFILE()
Close then current PDF document.

BEGINPAGE() as Integer
Inizialize a new page and then return the number.

ENDPAGE
Close the current page.

SETWORDSPACING(w as Single)
Set the word spacing, in points.

SETCHARSPACING(w as Single)
Set the char spacing, in points.

SETTEXTHORIZONTALSCALING(w as Single)
Set the horizontal expanding factor for the char, in percentual.

SETTEXTRENDERINGMODE(k as Byte)
Set the rendering mode for the text
(0=only fill, 1=only stroke, 2=stroke and fill).

SETCOLORSTROKE(color as Long)
Set the stroke color (RGB value) for line and stroke. If argument is negative and in smaller absolute value of 256, set a grayscale color.    

SETCOLORFILL(color as Long)
Set the fill color (RGB value) for space. If argument is negative and in smaller absolute value of 256, set a grayscale color.

SETDASH(dash_on As Single, Optional dash_off As Single)
Imposta le caratteristiche delle linee tratteggiate. SetDash(0) disattiva il tratteggio.    

SETLINEWIDTH(w as Single)
Imposta lo spessore delle linee e dei contorni.

SETLINECAP(k as Byte)
Imposta il modo in cui deve terminare una linea
(0=piatto, 1=semicerchio, 2=rettangolo).

SETLINEJOIN(k as Byte)
Imposta il modo con cui si intersecano le linee
(0=angolo netto, 1=semicerchio, 2=troncamento).

SETMITERLIMIT(w as Single)
Imposta la dimensione massima dell’intersezione delle linee (w >= 1).

MOVETO(x As Single, y As Single)
Inizia un nuovo percorso, impostando il punto corrente.

LINETO(x As Single, y As Single, Optional Options As pdfPathOptions = Stroked)   Aggiunge al percorso, una linea dal punto corrente alle coordinate passate
(Stroked=Aggiunge la linea al percorso, Filled=Chiude la figura e la riempie, Closed=chiude la figura, Nil=non fa nulla).

RECTANGLE(x As Single, y As Single, xdim As Single, ydim As Single, Optional options As pdfPathOptions = Stroked, Optional Ray As Single)
Aggiunge al percorso un rettangolo, con possibilità di arrotondare i bordi.

CURVE(x1 As Single, y1 As Single, x2 As Single, y2 As Single, x3 As Single, y3 As Single, Optional options As pdfPathOptions = Stroked)
Aggiunge al percorso una curva di Bezier.

DRAWCIRCLE(x As Single, y As Single, ray As Single, Optional options As pdfPathOptions = Stroked)
Aggiunge al percorso una circonferenza.

ARC(x As Single, y As Single, ray As Single, Optional startangle As Single = 0, Optional endangle As Single = 360, Optional ratio As Single = 1, Optional pie As Boolean = False, Optional rotate As Single = 0, Optional quality As Integer = 1, Optional options As pdfPathOptions = Stroked)
Aggiunge al percorso un arco, un’ellisse o un settore circolare.    

LOADIMGFROMBMPFILE(resourcename As String, filename As String, Optional colorspace As pdfColorSpace = pdfRGB) As Boolean
Aggiunge alle risorse una Bitmap da un file.

LEGGEBMP(filename As String, ByRef imgbuf() As Byte, ByRef imgcolor As String) As Boolean
Carica un vettore di byte con i dati immagine e colore di una Bitmap da file.    

LOADIMGFROMBUFFER(resourcename As String, ByRef imgbuf() As Byte, ByRef imgcolor As String, Optional colorspace As pdfColorSpace = pdfRGB)
Carica un vettore di byte con i dati immagine e colore di una Bitmap da file.    

DRAWIMG(resourcename As String, destx As Single, desty As Single, imgwidth As Single, imgheight As Single)   Disegna una Bitmap, prelevandola dell’elenco delle risorse.

LOADFONTSTANDARD(resourcename As String, fontname As String, Optional options As pdfFontStyle = pdfNormal)
Aggiunge alle risorse un font standard.

LOADFONT(resourcename As String, fontname As String, Optional options As pdfFontStyle = pdfNormal)   Aggiunge alle risorse un font TrueType.

DRAWTEXT(x As Single, y As Single, text As String, fontresourcename As String, fontsize As Single, Optional align As pdfTextAlign = pdfAlignLeft, Optional rotate As Single = 0)
Scrive il testo alle coordinate passate, con il font prelevato dalle risorse, eventualmente ruotato.

BEGINOBJECT(resourcename As String, Optional options As pdfObjectType = pdfNull)   Inizia la definizione di una risorsa riutilizzabile.

ENDOBJECT()
Termina la definizione di una risorsa riutilizzabile.

DRAWOBJECT(resourcename as String)
Disegna una risorsa riutilizzabile.

LENGTH(text As String, fontresourcename As String, fontsize As Single) As Single   Restituisce la lunghezza del testo utilizzando il font definito nelle risorse.Edit

Samples

´ Draw "Hello world" at point (1,15)
´ with font Times New Roman size 24 
Dim clPDF As New clsPDFCreator
 
With clPDF
  .ScaleMode = pdfCentimeter
  .InitPDFFile 
 
    .LoadFont "Fnt1", "Times New Roman"
 
    .BeginPage
      .DrawText 1, 15, "Hello world !", "Fnt1", 24
    .EndPage
 
  .ClosePDFFile
End With