N2PDFAddContent

Start page  Previous page  Next page

 

N2PDFAddContent ( <JobID>, <ContentType>, <ContentOption>, <Content>) -> <ErrorCode>

 

Description

You can use this function to add plain text to the PDF file. The text will be added at the current insertion point within the PDF. The formatting currently selected using N2PDFSetOption will be applied to this text. When you invoke this function you can also choose the area of the PDF file (header, footer or main text) where the content is to be inserted.

 

Declaration for LotusScript

Declare Function N2PDFAddContentW Lib LibName ( ByVal JobID As Long,_

ByVal ContentType As Long, ByVal  ContentOption As Long,_

ByVal Content As Unicode String ) As Long

 

Parameters

<JobID> (LONG)

The number that is returned when N2PDFInit is invoked and which references the PDF file in the memory. You use this ID to control which PDF you want to access with the function.

 

<ContentType> (LONG)

This parameter defines to which part of the PDF the content is amended (or attached). The following parameters are possible:

 

N2PDFVALUE_CONTENT_BODY

Attaches the content to the body of the PDF file

N2PDFVALUE_CONTENT_HEADER

Adds the content to the PDF's header.

N2PDFVALUE_CONTENT_FOOTER

Adds the content to the PDF's footer.

 

 

Depending on the <ContentType>, additional settings have to be defined by using the parameter <ContentOption>.

 

<ContentOption> (LONG)

This parameter defines the additional settings which apply to attaching the content to the PDF file. Depending on the <ContentType> different parameters may be used. The usage of more than one parameter at the same time is done by adding the individual values. The allocation of all values to the appropriate section of the PDF file can be found in the following table:

 

 

N2PDFVALUE_CONTENT_BODY

 

N2PDFVALUE_PAGEBREAK_AFTER

Adds a page break after the content.

N2PDFVALUE_PAGEBREAK_BEFORE

Adds a page break before the content.

N2PDFVALUE_CRLF_AFTER

Adds a line break after the content.

N2PDFVALUE_CRLF_BEFORE

Adds a line break before the content.

 

N2PDFVALUE_CONTENT_HEADER N2PDFVALUE_CONTENT_FOOTER

 

N2PDFVALUE_HF_ALL_PAGES

Adds the content as header or footer for all pages.

N2PDFVALUE_HF_FIRST_PAGE

Adds the content as header or footer for the first page only.

N2PDFVALUE_HF_LAST_PAGE

Adds the content as header or footer for the last page only.

N2PDFVALUE_HF_EVEN_PAGES

Adds the content as header or footer for all even pages only.

N2PDFVALUE_HF_ODD_PAGES

Adds the content as header or footer for all odd pages only.

N2PDFVALUE_HF_NOT_FIRST_LAST_PAGES

Adds the content as header or footer for all pages except for the first and last page.

 

 

112

Notes on Headers and Footers: The entire content will always be replaced. This means hat existing content may be deleted and replaced by new content. Should you want to define different headers and footers for different pages, you will have to activate the function more than one time and enter the different values in <ContentOption>.

 

<Content> (UNICODE STRING)

You use this parameter to assign the content to be added to the PDF file.

 

Return

<ErrorCode> (LONG)

The code number of the error that has occurred when performing the function (see "Error Codes ").