Delphi PDF Form Saver ActiveX
The Delphi ActiveX component is a wrapper around the default Aloaha PDF Form Saver OCX.
Sometimes non Microsoft compile do have problems to use standard components. For this reason Aloaha introduced the delphi wrapper. This wrapper contains only 1 Function and 1 Event to cover the Aloaha PDF Saver functionality. The Aloaha Delphi ActiveX component has such an easy structure that it can be used by virtually any non Microsoft Compiler.
DelphiAloaha Project Sample.zip (259,38 KB)
VB6 sample DelphiTest.zip (4,93 KB)Interfaces
The object name of the Delphi Wrapper is: DelphiAloaha.wrapp.
It contains one public function AloahaCommand and one Event AloahaEvent.
After you created the object you can pass via AloahaCommand commands to the Aloaha PDF Forms OCX.
Before "drawing" to object on your dialog please make sure that at a minimum you have the following units declared:
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, DelphiAloaha_TLB, OleCtnrs, ExtCtrls;
Should you not manage to see the DelphiAloaha component you need to import it from <commondir>aloaha. Please have a look also at the tipps at the end of this document.
AloahaCommand syntax
- adobe/aloaha
You can switch the OCX from Aloaha to Adobe mode with the command adobe. The Adobe mode uses the default PDF Viewer as PDF Viewer. To switch back to Aloaha Mode just use the command aloaha.
(Please note that in Adobe not every commands works due to the different architecture when using just a Reader to display PDF)
- adobe:overwrite:true/false
It is possible to toggle the behavior when clicking the red save button in Adobe mode. If overwrite is off a save to dialog is being shown.
- load/open
Just pass a load: or open: to the AloahaCommand followed by the path of the PDF to be opened. The path can be also an URL. For example load:http://www.aloaha.com/cache/fs5.pdf
The file to be opened can be also an XML file. Such an XML must contain a reference to a PDF document. Aloaha will open the XML and PDF, merge them and display the result!
- open
The open command instructs Aloaha to display the file open dialog.
- scroll
The scroll command scrolls the scrollbar by X percent. The possible range of X is from -100 to 100. For example scroll:10 scrolls 10% down.
- readonly
This command renders all formfields read-only. Read-only fields can still be edit from within the Aloaha PDF Saver. The read-only flag is only respected by other PDF Viewer such as the free Adobe Reader.
- saveas
The saveas command instructs Aloaha to save the document to the give location. The location could end with a .pdf to save as pdf or with .xml to export the formdata as xml. For example saveas:c:\data.xml
- save
The command save just saves the document without any user interaction.
- saveas
The command saveas opens the saveas dialog and saves the document to the choosen location.
- nextpage
Browses to the next page.
- previouspage
Browses to the previous page.
- printall
Prints document to the default printer.
- printpage
Prints active page to the default printer.
- get
Gets a form field value. For example get:Field1 would get the value of form field1
- set
Sets a form field value. For example set:Field1|JohnDoe would set the value of Field1 to JohnDoe
- nomenu
Disables all Aloaha Menues/Toolbars. Like that it is not even possible to print/save the PDF. (Secure PDF Viewer Mode)
- allowprint
Allows only printing
All functions return a string with the result of the command. The same string value is also fired as event.
Every PDF function explained on the Aloaha Website could be mapped to a command. Please do not hesitate to contact us if you require a special command from other modules!
More commands can be added on request.
Import ActiveX Control in Delphi
In Delphi 6+:
Set the Tools | Environment Options | Type library | Ignore CanCreate flags when importing option to true before importing the control.
In previous Delphi versions:
Use File|Open, set the filter to Type Library files, open the ocx, and have a look at the CanCreate flag in the type library editor. Set it to true, save the typelibrary as a tlb, and try importing that.
Aloaha Software / Knowledge Base / PDF Form Saver SDK / Delphi ActiveX