Aloaha PDF Forms OCX
The Aloaha PDF Form Saver is a very popular tool to fill in PDF forms visually and save the complete PDF Form to disk when finished.
An OCX/ActiveX version of the Aloaha PDF Form Saver is Included in the
Aloaha PDF Saver Professional. Sample source code to demonstrate the usage of the Aloaha PDF Form API and the Aloaha PDF Form OCX is included in:
<program files>\wrocklage\samples\formsaver
To reference the Aloaha PDF OCX/ActiveX please use the object
Aloaha.Editor
Demo.zip (25,84 KB)
Aloaha PDF OCX/ActiveX Events
The Aloaha PDF OCX/ActiveX Component triggers events whenever a PDF Form field changes or somebody clicks the form field with the mouse. This is for example useful if you would like to connect your PDF Forms to a database and update any PDF changes to the database immediately.
Please find below a list of events in VB6 notation:
- Private Sub editor_FieldKeyPressed(hDC As Long, hwnd As Long, FieldIndex As Long, value As String, defaultvalue As String, Page As Long, Title As String, FType As Long, KeyAscii As Integer)
- Private Sub editor_FieldChange(hDC As Long, hwnd As Long, FieldIndex As Long, value As String, defaultvalue As String, Page As Long, Title As String, FType As Long)
- Private Sub editor_FieldClick(hDC As Long, hwnd As Long, FieldIndex As Long, value As String, defaultvalue As String, Page As Long, Title As String, FType As Long)
- Private Sub editor_FieldDblClick(hDC As Long, hwnd As Long, FieldIndex As Long, value As String, defaultvalue As String, Page As Long, Title As String, FType As Long)
Variables
- hDC As Long
This is the Handle to the Device Context of the OCX Form.
- hwnd As Long
This is the Handle to the FormField. This is useful if you need to send data with the Windows API SendMessageA to the Field.
- FormFieldCount contains the number for form fields.
- FormFieldsCollection is a collection of all available form fields incl. their properties.
- FieldIndex As Long
This is the Field Index as used by Aloaha internally.
- Value As String
The Formfield Value.
- DefaultValue As String
The Default Value of the Formfield.
- Page As Long
The Page Number on which the Formfield is situated.
- Title As String
The Form Field Title.
- FType As Long
Type of Formfield. 1 for example stands for Text Field.
- KeyAscii As Integer
Ascii Value of the Keyboard key pressed.
- FormFieldJavaScript(FormFieldID,ActionType)
Returns the JavaScript assigned to FormFieldID and ActionType.
ActionType is defined in Enum JavaScriptAction
- Cursor_Enter = 0
- Cursor_Exit = 1
- Mouse_Button_Down = 2
- Mouse_Button_Up = 3
- Get_Focus = 4
- Loose_Focus = 5
- Key_Pressed = 6
- Before_Display = 7
- Value_Changed = 8
- ReCalculate = 9
Aloaha PDF Form Saver OCX/ActiveX Functions
Aloaha offers a broad range of functions to manipulate PDF Forms. Please find a list of them below.
- function open_PDF(pdfpath As String) As Boolean
opens the given PDF Document inside the OCX.
Resizing, Scrollbar positioning etc will be done fully automatic.
- Sub set_dpi(newdpi As Long)
Sets the Display DPI. Valid Values are 72, 144, 300, 600 etc.
Default is 144.
- Function get_default_printer() As String
Returns the default printer name
- Function get_printer_list_CSV() As String
Returns all System Printer as comma seperated list.
- Public Function print_current_pdf(printername As String, StartPage As Long, EndPage As Long, PageScaling As Long, AutoRotate As Boolean, SpoolerTitle As String) As Boolean
Prints the open PDF Document to the given printer.
- Function save(targetpath As String) As Boolean
Saves the opened PDF to Target
- Function saveas() As Boolean
Openes the Windows Dialog SaveAs and Saves Document to destination
- Function ActivateField(FieldID As Long, hwnd As Long, Title As String) As Boolean
Instructs the PDF OCX to browse to the page this Field is located and plase the Windows Cursor into the field specified by FieldID, HWND or Title. Please note that only one of the 3 variables has to be specified. For example you could Call ActivateField(0,0,"Surname") to activate the first field with Title Surname.
- Function get_value_by_ID(ValueID As Long, value As String) As Boolean
Function set_value_by_ID(ValueID As Long, value As String) As Boolean
With a given ValueID you can set or get directly a formfield value. ValueIDs are running numbers from 1 to FormFieldCount. Accessing FormFields via ID is the fastest method!
- Function get_value_by_TITLE(ValueTITLE As String, value As String) As Boolean
Function set_value_by_TITLE(ValueTITLE As String, value As String) As Boolean
Having the Title of your formfield you can set/get the Formfield Value directly with this function.
- Function get_value_by_HWND(ValueHWND As Long, value As String) As Boolean
Function set_value_by_HWND(ValueHWND As Long, value As String) As Boolean
This function allows to get/set a Formfield Value by FormField Handle.
- Function call disable_menus disables access to the menues. Enable_menues re-enables access.
- With show_toolbar it is possible to start the toolbar.
- Allow_edit(true/false) allows or disallows edit functions.
Other Methods, Functions and Variables
Should you require different Methods, Events, Functions or variables please do not hesitate to contact us. It would be a pleasure to add your needed functionality to our PDF Filler OCX.
Aloaha ActiveX Sample
Please find below some sample code which demonstrates how to integrate Aloaha into a website!
fs5.html (1,90 KB)Please ask...
Although we really tried hard, there are always questions left open. But perhaps somebody else had already put the same question?
Please check!
If I include this OCX within my application and install it on different PCs do I need to purchase a license for each one or is it a Royality free distributed license with a one time purchase like most are?
In case you include the OCX in your applicaton you need to purchase either a license for every target machine OR you need a royalty free license. Royalty free licenses are usually feasable if the application is distributed to several thousands of machines.
Answered 18.03.2009
If not, please do not hesitate to send us your question.
We would be glad to answer it.
Home / Knowledge Base / PDF Form Saver SDK / PDF Forms OCX