PDF generation.

Version 1.4


Based on:

https://parall.ax/products/jspdf

https://rawgit.com/MrRio/jsPDF/master/docs/jsPDF.html


Sample App:
https://visualneo.com/tutorials/neopdf

 

neoPdfInit

Purpose:

Initializes PDF document

Category:

neoPDF

Syntax:

neoPdfInit "pdfName" paperSize orientation

 

pdfName

Enter a name for your PDF (just letters, no spaces)

paperSize

Paper size

orientation

Orientation

 

neoPdfInitCustomSize

Purpose:

Initializes PDF document with a custom paper size

Category:

neoPDF

Syntax:

neoPdfInitCustomSize "pdfName" orientation units thewidth theheight

 

pdfName

Enter a name for your PDF (just letters, no spaces)

orientation

Orientation

units

Measurement unit to be used when coordinates are specified

thewidth

Width (in pt)

theheight

Height (in pt)

 

neoPdfProperties

Purpose:

Define document metadata

Category:

neoPDF

Syntax:

neoPdfProperties "pdfName" "pdfTitle" "pdfSubject" "pdfAuthor" "pdfKeywords"

 

pdfName

PDF name

pdfTitle

Document title

pdfSubject

Document subject

pdfAuthor

Document author

pdfKeywords

Document keywords (comma separated)

 

neoPdfDisplayMode

Purpose:

Set the display mode options of the pages

Category:

neoPDF

Syntax:

neoPdfDisplayMode "pdfName" layout pmode

 

pdfName

PDF name

layout

Layout

pmode

Pmode

 

neoPdfRender

Purpose:

Generates the PDF document and renders it wihin an IFrame object

Category:

neoPDF

Syntax:

neoPdfRender "pdfName" "objId"

 

pdfName

PDF name

objId

IFrame object to render the PDF document

 

neoPdfRenderInNewTab

Category:

neoPDF

Syntax:

neoPdfRenderInNewTab "pdfName"

 

pdfName

PDF name

 

neoPdfToBase64

Purpose:

Generates the PDF document and saves it to a variable in Base64 encoded format.


IMPORTANT: It takes up to 0.5 secs to render.

Category:

neoPDF

Syntax:

neoPdfToBase64 "pdfName" resVar

 

pdfName

PDF name

resVar

Variable to store result

 

neoPdfDownload

Purpose:

Saves the document as PDF (download).

Category:

neoPDF

Syntax:

neoPdfDownload "pdfName"

 

pdfName

PDF name

neoPdfDownloadFile

Purpose:

Saves the document as PDF with a custom file name (download).

Category:

neoPDF

Syntax:

neoPdfDownloadFile "pdfName" "fileName"

 

pdfName

PDF name

fileName

File name with no extension ie: 'myfile'


neoPdfSimpleText

Purpose:

Adds text to page with simplified options.

Category:

neoPDF

Syntax:

neoPdfSimpleText "pdfName" textString posX posY textAlign

 

pdfName

PDF name

textString

Text to write

posX

X coordinate (in milimeters)

posY

Y coordinate (in milimeters)

textAlign

Text align

 

neoPdfText

Purpose:

Adds text to page with complete options.

Category:

neoPDF

Syntax:

neoPdfText "pdfName" textString posX posY textAlign textAngle maxWidth renderingMode

 

pdfName

PDF name

textString

Text to write

posX

X coordinate (in milimeters)

posY

Y coordinate (in milimeters)

textAlign

Text align

textAngle

Angle in degrees. Rotate the text counterclockwise

maxWidth

Split the text by given width, 0 = no split.

renderingMode

Rendering Mode

 

neoPdfTextLink

Purpose:

Adds text with a link.

Category:

neoPDF

Syntax:

neoPdfTextLink "pdfName" textString posX posY "linkurl"

 

pdfName

PDF name

textString

Text to write

posX

X coordinate (in milimeters)

posY

Y coordinate (in milimeters)

linkurl

URL to link to (ie: https://google.com)

 

neoPdfTextLinkToPage

Purpose:

Adds text with a link to another page.

Category:

neoPDF

Syntax:

neoPdfTextLinkToPage "pdfName" textString posX posY linkpage

 

pdfName

PDF name

textString

Text to write

posX

X coordinate (in milimeters)

posY

Y coordinate (in milimeters)

linkpage

Number of page to link to

 

neoPdfAddSystemFont

Purpose:

Add a system font to the document. Not visible if font not installed.

Category:

neoPDF

Syntax:

neoPdfAddSystemFont "pdfName" fileName "fontName"

 

pdfName

PDF Name

fileName

File name (ttf format)

fontName

Font name

 

neoPdfFont

Purpose:

Sets text font face for upcoming text elements.

Category:

neoPDF

Syntax:

neoPdfFont "pdfName" fontName

 

pdfName

PDF name

fontName

Font name

 

neoPdfFontStyle

Purpose:

Switches font style or variant for upcoming text elements, while keeping the font face or family same.

Category:

neoPDF

Syntax:

neoPdfFontStyle "pdfName" fontStyle

 

pdfName

PDF name

fontStyle

Font style

 

neoPdfFontSize

Purpose:

Sets font size for upcoming text elements.

Category:

neoPDF

Syntax:

neoPdfFontSize "pdfName" "fontSize"

 

pdfName

PDF name

fontSize

Font size (in points)

 

neoPdfTextColor

Purpose:

Sets the text color for upcoming elements.

Category:

neoPDF

Syntax:

neoPdfTextColor "pdfName" redValue greenValue blueValue

 

pdfName

PDF name

redValue

Red value (0-255)

greenValue

Green value (0-255)

blueValue

Blue value (0-255)

 

neoPdfLineHeightFactor

Purpose:

Sets the Line Height Factor of proportion.


To increase or decrease distance between text lines.

Category:

neoPDF

Syntax:

neoPdfLineHeightFactor "pdfName" lineFactor

 

pdfName

PDF name

lineFactor

Line factor (default 1.15)

 

neoPdfAddPage

Purpose:

Add a new page to the PDF document.

Category:

neoPDF

Syntax:

neoPdfAddPage "pdfName" orientation paperSize

 

pdfName

PDF name

orientation

Orientation of the page (optional)

paperSize

Paper size (optional)

 

neoPdfMovePage

Purpose:

Moves a page before another one.

Category:

neoPDF

Syntax:

neoPdfMovePage "pdfName" targetPage beforePage

 

pdfName

PDF Name

targetPage

Target page number

beforePage

Before page number

 

neoPdfSetPage

Purpose:

transfers the focus to the givenr page.

Category:

neoPDF

Syntax:

neoPdfSetPage "pdfName" pageNumber

 

pdfName

PDF Name

pageNumber

Page number

 

neoPdfInsertPage

Purpose:

Insert a new page in a given position.

Category:

neoPDF

Syntax:

neoPdfInsertPage "pdfName" pageNumber

 

pdfName

PDF Name

pageNumber

Before page number

 

neoPdfDeletePage

Category:

neoPDF

Syntax:

neoPdfDeletePage "pdfName" pageNumber

 

pdfName

PDF name

pageNumber

Page number to delete

 

neoPdfImage

Purpose:

Adds an image to the PDF.


WARNING: Due to cross scripting it only works on a server.

Category:

neoPDF

Syntax:

neoPdfImage "pdfName" "imgObj" imgFormat posX posY imgWidth imgHeight

 

pdfName

PDF name

imgObj

Img Obj

imgFormat

Image format

posX

X coordinate (in mm)

posY

Y coordinate (in mm)

imgWidth

Image width (in mm)

imgHeight

Image height (in mm)

 

neoPdfImageBase64

Purpose:

Adds an image to the PDF from


base64 enconded image data (www.base64-image.de)

Category:

neoPDF

Syntax:

neoPdfImageBase64 "pdfName" imgObj imgFormat posX posY imgWidth imgHeight

 

pdfName

PDF name

imgObj

Base64 enconded image data (base64-image.de)

imgFormat

Image format

posX

X coordinate (in mm)

posY

Y coordinate (in mm)

imgWidth

Image width (in mm)

imgHeight

Image height (in mm)

 

neoPdfHtmlTable

Purpose:

Adds a HTML table to the PDF document

Category:

neoPDF

Syntax:

neoPdfHtmlTable "pdfName" "tableName" posY theTheme red blue green

 

pdfName

PDF name

tableName

HTML table id

posY

Y coordinate (in milimeters)

theTheme

Theme

red

Red value (0-255) for header color

blue

Blue value (0-255) for header color

green

Red value (0-255) for header color

 

neoPdfNeoTable

Category:

neoPDF

Syntax:

neoPdfNeoTable "pdfName" "neoTableContainer" posY "theTheme" red blue green

 

pdfName

PDF name

neoTableContainer

neoTable Container

posY

Y coordinate (in milimeters)

theTheme

Theme (striped, grid or plain)

red

Red value (0-255) for header color

blue

Blue value (0-255) for header color

green

Green value (0-255) for header color

 

neoPdfHtml

Purpose:

Adds a HTML text to the PDF document.


Supports embeded styles.

Category:

neoPDF

Syntax:

neoPdfHtml "pdfName" htmlCode posX posY

 

pdfName

PDF name

htmlCode

HTML code

posX

X coordinate (in milimteres)

posY

Y coordinate (in milimteres)

 

neoPdfLine

Purpose:

Draw a line on the current page

Category:

neoPDF

Syntax:

neoPdfLine "pdfName" x1 y1 x2 y2

 

pdfName

PDF name

x1

X1 coordinate (in milimeters)

y1

Y1 coordinate (in milimeters)

x2

X2 coordinate (in milimeters)

y2

Y2 coordinate (in milimeters)

 

neoPdfLineWidth

Purpose:

Sets line width for upcoming lines.

Category:

neoPDF

Syntax:

neoPdfLineWidth "pdfName" lineWidth

 

pdfName

PDF name

lineWidth

Line width (in milimeters)

 

neoPdfDrawColor

Purpose:

Sets the stroke color for upcoming elements.

Category:

neoPDF

Syntax:

neoPdfDrawColor "pdfName" red green blue

 

pdfName

PDF name

red

Red value (0-255)

green

Green value (0-255)

blue

Blue value (0-255)

 

neoPdfFillColor

Purpose:

Sets the fill color for upcoming elements.

Category:

neoPDF

Syntax:

neoPdfFillColor "pdfName" red green blue

 

pdfName

PDF name

red

Red value (0-255)

green

Green value (0-255)

blue

Blue value (0-255)

 

neoPdfCircle

Purpose:

Adds an circle to PDF.

Category:

neoPDF

Syntax:

neoPdfCircle "pdfName" x1 y1 radio circleStyle

 

pdfName

PDF name

x1

X coordinate of circle center (in millimeters)

y1

Y coordinate of circle center (in millimeters)

radio

Circle radio (in millimeters)

circleStyle

Circle style

 

neoPdfEllipse

Purpose:

Adds an circle to PDF.

Category:

neoPDF

Syntax:

neoPdfEllipse "pdfName" x1 y1 radiox radioy circleStyle

 

pdfName

PDF name

x1

X coordinate of ellipse center (in millimeters)

y1

Y coordinate of ellipse center (in millimeters)

radiox

Ellipse x-radio (in millimeters)

radioy

Ellipse y-radio (in millimeters)

circleStyle

Ellipse style

 

neoPdfTriangle

Purpose:

Adds a triangle to the PDF

Category:

neoPDF

Syntax:

neoPdfTriangle "pdfName" x1 y1 x2 y2 x3 y3 rStyle

 

pdfName

PDF name

x1

X coordinate first point

y1

Y coordinate first point

x2

X coordinate second point

y2

Y coordinate second point

x3

X coordinate third point

y3

Y coordinate third point

rStyle

Triangle style

 

neoPdfRect

Purpose:

Adds a rectangle to the PDF

Category:

neoPDF

Syntax:

neoPdfRect "pdfName" x1 y1 rwidth rheight rStyle

 

pdfName

PDF name

x1

X coordinate upper left corner (in millimeters)

y1

Y coordinate upper left corner (in millimeters)

rwidth

Rectangle width (in millimeters)

rheight

Rectangle height (in millimeters)

rStyle

Rectangle style

 

neoPdfRoundRect

Purpose:

Adds a rounded rectangle to the PDF

Category:

neoPDF

Syntax:

neoPdfRoundRect "pdfName" x1 y1 rwidth rheight radius rStyle

 

pdfName

PDF name

x1

X coordinate upper left corner (in millimeters)

y1

Y coordinate upper left corner (in millimeters)

rwidth

Rectangle width (in millimeters)

rheight

Rectangle height (in millimeters)

radius

Border radius (in millimeters)

rStyle

Rectangle style

 

neoPdfGetDrawColor

Purpose:

Get the current draw color

Category:

neoPDF

Syntax:

neoPdfGetDrawColor "pdfName" [thecolor]

 

pdfName

PDF name

thecolor

Variable to store result

 

neoPdfGetFillColor

Purpose:

Get the current fill color

Category:

neoPDF

Syntax:

neoPdfGetFillColor "pdfName" [thecolor]

 

pdfName

PDF name

thecolor

Variable to store result

 

neoPdfGetTextColor

Purpose:

Get current text color

Category:

neoPDF

Syntax:

neoPdfGetTextColor "pdfName" [thecolor]

 

pdfName

PDF name

thecolor

Variable to store result

 

neoPdfGetFontSize

Purpose:

Get the current font size

Category:

neoPDF

Syntax:

neoPdfGetFontSize "pdfName" [thesize]

 

pdfName

PDF name

thesize

Variable to store result

 

neoPdfAutoPrint

Purpose:

Print the PDF document just after rendering or opened.

Category:

neoPDF

Syntax:

neoPdfAutoPrint "pdfName"

 

pdfName

PDF Name

 

neoPdfAutoPrint2

Purpose:

Print the PDF document just after rendering or opened (alterntive method)

Category:

neoPDF

Syntax:

neoPdfAutoPrint2 "pdfName"

 

pdfName

PDF Name