NTPExportReport ( <ReportHandle>, <PageNr>, <ExportFormat>, <OutputFile>, <StretchSize>, <PaperOptions>, <PDFOptions>, <DocSummary>, <PaperFormat>, <Security> ) -> <ErrorCode>
Description
This command activates the PDF export filter. This is a command that is provided by NotesToPaper, which is automatically available in the application once NotesToPaper has been integrated. The NotesToPaper export interface is referenced via NTPExportReport allowing all the installed export filters to be used. Each parameter's task differs according to the export filter being used (see also the definition of the commands in the NotesToPaper Online Help).
Individual pages or an entire report can be exported when using NotesToPaper PDF. Settings can also be made, such as for resolution, orientation, scaling and PDF options. The individual parameters are listed and explained below.
The prerequisites for exporting a report are that the report was created for the preview (see NTPProcessReport...in the NotesToPaper Online-help) and that the option NTPOPTION_KEEPREPORT was activated with the NTPSetOption command.
Note: All commands and their descriptions can be found in the "Functions" chapter in the NotesToPaper Online Help.
The option NTPOPTION_KEEPREPORT stops the report from immediately being deleted after it has been created (and displayed). This is extremely important, since the export filter accesses the existing report file (preview file) and uses it to generate the PDF export.
Note: NotesToPaper differentiates between two forms of report export: With NTPExportReport reports are converted into a different format after they have been created as preview files. This conversion must be done through the programming. In contrast, the export filters, which can be selected in the printer dialog, generate the report directly in the desired format without using the preview file. These export filters are available without the need for any further programming.
Declaration for LotusScript
Declare Function NTPExportReport Lib "NTP.DLL" ( ByVal ReportHandle As Long, ByVal PageNr As Long, ByVal ExportFormat As Long, ByVal OutputFile As String, ByVal StretchSize As Long, ByVal PaperOptions As Long, ByVal PDFOptions As Long, ByVal DocSummary As String, ByVal PaperFormat As String, ByVal Security As String ) As Long
Parameters
<ReportHandle> (LONG)
The report handle that was returned when invoking NTPInit or NTPInitFromDatabase.
<PageNr> (LONG)
Page number of the report to be exported. When set at 0, all reports will be exported.
<ExportFormat> (LONG)
Graphic format for the export. With NotesToPaper PDF 6 ( = PDF format for NotesToPaper) must be assigned here.
<OutputFile> (STRING)
File names for the graphics export. This file name can, for example, be generated by the NTPCreateTempFile function and must bear the extension .pdf. The file name should include the path designation.
Note: Constants are used with the following parameters. These constants stand for specific text or numerical values. You can find the definitions of these constants in the annex to this documentation. You should incorporate these constants in your script programming or you will have to replace them with the corresponding values when passing the parameters.
<StretchSize> (LONG)
This parameter is used to determine if the size of a page in the report file will be adjusted to the size of a page in the PDF file or if the report should be exported without being scaled. If scaling is not selected, then the report's paper size should correspond to the PDF paper size.
Note: This setting is only relevant in connection with a user-defined paper format.
NTPEXPORT_PDF_DRAWMODE_NORMAL |
= Original size |
NTPEXPORT_PDF_DRAWMODE_FIT |
= Fit in page |
<PaperOptions> (LONG)
This parameter can be used to set a number of options for the page view of the PDF file. The values of this parameter are treated as a bit mask, meaning they must include the Boolean OR operator (aggregate).
Paper Orientation
You can use the following values to define how the paper is oriented in PDF format.
Note: setting is only relevant in connection with a user-defined paper format.
NTPEXPORT_PDF_PORTRAIT |
Portrait orientation
|
NTPEXPORT_PDF_LANDSCAPE |
Landscape orientation |
View Mode
The "page mode" options allow you to specify how a PDF file will be opened in the respective display program (insofar as the display program allows for such settings).
NTPEXPORT_PDF_PAGEMODE_FULLSCREEN |
PDF will be opened in full-screen mode |
NTPEXPORT_PDF_PAGEMODE_THUMBNAILS |
PDF file displayed with opened thumbnails |
NTPEXPORT_PDF_PAGEMODE_OUTLINE |
PDF file displayed with opened outlines |
Zoom Mode
The "zoom mode" option lets you select how the page will appear in the display program when the PDF file is opened.
NTPEXPORT_PDF_ZOOMMODE_FITHORIZONTAL |
The page will be made to fit to its maximum horizontal size. |
NTPEXPORT_PDF_ZOOMMODE_FITVERTICAL |
The page will be made to fit to its maximum vertical size. |
NTPEXPORT_PDF_ZOOMMODE_FITPAGE |
The page will be adjusted so that the whole page is visible. |
<PDFOptions> (LONG)
This parameter can be used to set a number of options for the page view of the PDF file. The values of this parameter are treated as a bit mask, meaning they must include the Boolean OR operator (aggregate).
Fonts
This option gives you the choice of allowing TrueType fonts to be integrated in the PDF file. Please keep in mind that if the fonts are not embedded, the PDF files may be displayed incorrectly should such a font be unavailable on the system. Likewise, you should remember that embedding fonts has a major impact on the size of the PDF file.
NTPEXPORT_PDF_FONT_USE_TRUETYPE |
Use TrueType fonts but do not embed the font data |
NTPEXPORT_PDF_FONT_EMBED_TRUETYPE |
Embed all TrueType font data that are to be used |
NTPEXPORT_PDF_FONT_EMBED_TRUETYPE_SYMBOL |
Embed only symbol (WingDings, etc.) TrueType fonts |
NTPEXPORT_PDF_FONT_USE_14BASE_TYPE1 |
Use no TrueType fonts. Only the fonts Arial, Courier New and Times New Roman will be used when this mode is activated. |
It is possible to embed only those parts of the fonts that are to be used, instead of embedding the complete font packages (as described above).
NTPEXPORT_PDF_FONT_EMBED_TRUETYPE_CSET |
Embeds only the data of the used TrueType font, including all those that are part of the current codepage. Please ensure that the embed is made according to the codepage on which the PDF file is to be created. |
NTPEXPORT_PDF_FONT_EMBED_TRUETYPE_USED |
Embeds the data of the used TrueType fonts and only those characters utilized within the PDF file. |
CID format is a PostScript format specifically developed by Adobe for extensive character sets, e.g. Chinese, Japanese or Korean. The CID format enables PDF files to be created with embedded character sets. CID stands for "Character Identifier", which in turn refers to the "Character Identifier Numbers" which are used to index and find individual characters in the font. A CID font consists of a large file with outline descriptions of characters and a small "CMap" file containing the character list, coding and "Character Identifier".
NTPEXPORT_PDF_FONT_CIDMODE_UNICODE |
Enableds the creation of CID fonts or to use CMaps for the layout of the PDF file. |
File Size (Graphics and Content Compression)
The following parameters let you compress the content of a PDF file (deflate method). When compression is activated, the content is stored as binary information not as ASCII information.
NTPEXPORT_PDF_COMPRESSION |
Activates compression of PDF content |
The JPEG compression options are suitable only for TrueColor images.
NTPEXPORT_PDF_JPEGLEVEL_LOWEST |
Best compression, worst image quality |
NTPEXPORT_PDF_JPEGLEVEL_LOW |
... |
NTPEXPORT_PDF_JPEGLEVEL_MEDIUM |
... |
NTPEXPORT_PDF_JPEGLEVEL_HIGH |
... |
NTPEXPORT_PDF_JPEGLEVEL_HIGHEST |
Worst compression, best image quality |
Others
NTPEXPORT_PDF_LAUNCH_APPLICATION |
Starts the operating system's PDF file viewer after the file has been created. |
NTPEXPORT_PDF_CONVERT_HYPERLINK |
Converts text that describes a hyperlink into a genuine link.Important: This works only in links that are not located within a text, but exist instead as individual text objects. |
NTPEXPORT_PDF_CREATE_THUMBNAILS |
Creates thumbnails for each page in the PDF file.Important: This setting should only be used when the PDF file is being created for older Acrobat Reader versions (before 5). Not only does Acrobat Reader create these thumbnails itself for versions 5 and above, they are also of better quality. |
<DocSummary> (STRING)
These parameters are used to set the properties of the PDF document's summary. The Document Summary can be accessed under Document Properties using Acrobat Readers.
The values are placed in the following order within a string that contains the various values separated with a semicolon (;):
- Title
- Subject
- Author
- Keywords
- Producer
<PaperFormat> (STRING)
This parameter lets you set a custom paper format. Values are given in a string that contains the different values separated by a semicolon (;).
Note: You should only use this parameter when using a paper format in the PDF file that varies from that of the report. The paper format will be recognized automatically if you make no settings for this parameter.
Example: "1;5000;4000;600;600"
The first value in the string determines the paper format. The following values are allowed:
1 = Letter 8 ½ x 11 in
5 = Legal 8 ½ x 14 in
8 = A3 297x420 mm
9 = A4 210x297 mm
256 = User-defined format
Note: If the value 256 is entered, then the paper size must be specified using whatever values follow it.
Note: If you enter a custom paper size, then the first value (paper format) will automatically be set at 256 (user-defined format) and the original first entry will be ignored.
Values two and three determine the paper's width and height. Values are given in tenths of a millimeter (mm/10).
Values four and five specify the horizontal and vertical margins. Values are given in tenths of a millimeter (mm/10. The default setting for the margins is 60 (6 mm).
<Security> (STRING)
These parameters are used to set the passwords (user and master passwords), the security flags (print, change, copy, fill-in) for access to the PDF file and the type of encryption (40 or 128-bit). Values are given in a string that contains the different values separated by a semicolon (;). Values are given in the following order:
- Master password
- User password
- Printing allowed
- Changing allowed
- Copying allowed
- Authoring and form fields allowed
- Encryption levels
The first two parameters set the passwords. Parameters three through six determine the flags for the security settings. The encryption level is set using parameter seven.
All flags are set at default ("1"), which means that all PDF operations are allowed. If you want to disallow certain operations then the related parameter must be set to "0". The default encryption level is set at 128 bits ("1").
Note: For more information on passwords and security settings, please read the document "PDF security settings"
Example: "Owner; User; 1; 0; 1; 0; 1"
This parameter string sets the owner password to "owner" and the user password as "user". Printing and copying the PDF file remains allowed. The operations "changing" and "form fields" are then disallowed. The entire file is encrypted at 128 bits.
Return value
<ErrorCode> (LONG)
The code number of the error that has occurred (0 = No error). A list of all error codes can be found in the document "error codes".