npPdfs plugin

About this plugin

This plugin allow you to create your own PDF files in an easy way and without the need of any thirdty files. You can add text, columns, rows, headers, footers, bitmaps and more into your own customized PDF files.

You can instantiate more than one Pdf object and begin to add headers, titles, text, images, columns, footer, etc. Also the plugin provide actions to add new lines and pages, print one or more pages, etc., and finaly can save the PDF file.

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npPdfsCreate

Create a new instance of an Pdf object. The result variable store the numeric ID for the created object. Then you can use this numeric ID with the other plugin actions.

↑↑

npPdfsDestroy

Destroy a previously created instanace of an Pdf object. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsDestroyAll

Destroy all previously created instances of Pdf objects.

↑↑

npPdfsBeginDoc

Begin the PDF document for the specified Pdf object instance. Every PDF document must start with this action and end with npPdfsEndDoc. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsEndDoc

End the current PDF document for the specified Pdf object instance. Every PDF document must start with npPdfsEndDoc and end with this action. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsBackground

Set an image background for all the pages of the Pdf object instance. Supported image formats are BMP, JPG, PNG and GIF. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsProperties

Set certain PDF document properties for the specified Pdf object instance. This properties are explained below:

The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsSaveToFile

Save the current ended PDF document into the selected path from the specified Pdf object instance. Remember npPdfsEndDoc must be called before this action. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsTextFormat

Set the font, color, background and other text format properties for the specified Pdf object instance. This properties are explained below:

This action must be called before npPdfsBeginDoc if you want to set the PDF orientation. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsSaveLayout

Save the current document layout for the specified Pdf object instance. Save the current font and alignment. See also npPdfsRestoreLayout. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsRestoreLayout

Restore the previously saved document layout for the specified Pdf object instance. See also npPdfsSaveLayout. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsAddLineToHeader

Add a single or double line to the document header of the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsAddTextToHeader

Add some text to the document header of the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsAddTextToHeaderAt

Add some text to the specified horizontal position on document header of the specified Pdf object instance. This method do not increment the vertical position, so can be used to add multiple text on the same line. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsAddLineToFooter

Add a single or double line to the document footer of the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsAddTextToFooter

Add some text to the document footer of the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsAddTextToFooterAt

Add some text to the specified horizontal position on document footer of the specified Pdf object instance. This method do not increment the vertical position, so can be used to add multiple text on the same line. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsAddPagesToFooter

Add current and total pages numbers to the document footer of the specified Pdf object instance. The text you can specify must to contain two "%d" format marks, then the first mark is replaced by the current page number and the second mark is replaced by the total pages number. One example of text to use with this action can be "Page %s of %d", which produce a result similar to: "Page 3 of 5". The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsAddColumns

Register columns by percentages and the specified text align to the specified Pdf object instance. Sum of all percent width should be 100, but can be of any value. Negative widths are converted into absolute values, but corresponding alignment is set to right. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

Note this action register the columns, but you need to use npPdfsAddColumnsHeaders to add the columns headers text and then npPdfsDrawColumns to add the columns text.

↑↑

npPdfsSetColumnBold

Set the font bold style of a previously registered column in the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

Note before to use this action you need to register the columns using npPdfsAddColumns.

↑↑

npPdfsSetColumnAlign

Set the alignment of a previously registered column in the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

Note before to use this action you need to register the columns using npPdfsAddColumns.

↑↑

npPdfsAddColumnsHeaders

Set the headers text and others properties of previously register columns on the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

Note before to use this action you need to register the columns using npPdfsAddColumns and after use this action the npPdfsDrawColumns to add the columns text.

↑↑

npPdfsDrawText

Draw the text that you wanted into the specified Pdf object instance. Note this action handle the appropiate word wrapping and allow various paragraphs separated by new lines. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsDrawText

Draw the text that you wanted at the specified X position into the specified Pdf object instance. Note this action NOT handle the appropiate word wrapping and NOT allow various paragraphs separated by new lines. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsDrawTitle

Draw text as a paragraph title into the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsDrawBitmap

Draw the bitmap image file that you wanted into the specified Pdf object instance. Note that:

The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsDrawRtfFile

Append the content of an RTF file into the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsDrawColumns

Draw the content of the columns previously defined into the specified Pdf object instance. Before use this action you need to call both npPdfsAddColumns and npPdfsAddColumnsHeaders. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsDrawLine

Draw a line into the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsDrawDashedLine

Draw a dashed line into the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsNewLine

Jump some line space between paragraphs into the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsNewLines

Jump some lines space between paragraphs into the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsNewHalfLine

Jump some half line space between paragraphs into the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsNewPage

Force a new page into the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsGetMargins

Get the document left and right margins from the specified Pdf object instance. The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsPrintPages

Print the specified pages of the PDF document or show the printer config dialog of the specified Pdf object instance. If "From page" and "To page" are "0" (zero) all pages are printed. If "From page" and "To page" are "-1" the printer config dialog is shown.

The result variable store "True" if everything is OK, or "False" if an error occur. In this case the [LastError] store the error information.

↑↑

npPdfsHasSpaceFor

Find if the current page have vertical space for the specified millimeters on the specified Pdf object instance. The result variable store "True" if the page have space, or "False" when not. Note that the result variable can also contain "False" if an error ocurr: In this case the [LastError] store the error information.

↑↑

npPdfsHasSpaceForLines

Find if the current page have vertical space for the specified lines number on the specified Pdf object instance. The result variable store "True" if the page have space, or "False" when not. Note that the result variable can also contain "False" if an error ocurr: In this case the [LastError] store the error information.

↑↑

Action errors subroutine

All the NeoPlugins deal with errors in the same way that NeoBook does: when the plugin found an action error the [LastError] variable store information about the error, so you can take care about this variable when execute an action.

But all the NeoPlugins also incorporate an advanced way to deal with possible action errors. You can define a subroutine named OnNeoPluginActionError in order to be executed when some action error are found and you can use this variables inside:

Note that this error handling subroutine are shared for all the NeoPlugins, so you no need to specify a subroutine for every plugin you use in your publication because the same subroutine are recognized and automagically used by every NeoPlugin. Below you can view a sample of this subroutine code:

:OnNeoPluginActionError
  AlertBox "NeoPlugin Error" "Error [LastError] in plugin: [PluginName]"
Return

Also note that the use of this NeoPlugins error handling subroutine is completelly optional. You can continue using the [LastError] variable as usual and even use the both methods at the same time.

↑↑