ImportRichTextEdit
PowerScript function
Description
Imports the content of the specified RichTextEdit object to the PDF
document.
Applies to
PDFDocument object in Objects and Controls
Syntax
|
1 |
long ImportRichTextEdit(RichTextEdit richTextEdit) |
|
1 |
long ImportRichTextEdit(RichTextEdit richTextEdit, long targetIndex) |
|
Argument |
Description |
|---|---|
|
richTextEdit |
The name of the RichTextEdit object to be imported in the |
| targetIndex | The page index at which to insert the RichTextEdit content. If not specified, the content will be inserted to the end of the document. |
Return value
Long. Returns 1 if it succeeds and -1 if it fails. For more errors,
see the Error Codes.
Usage
Call the function to insert the content of the RichTextEdit object
in the PDF document. Note that it is only possible to insert RichTextEdit
in a PDF document that follows the “PDF_None!” standard.
The content of the RichTextEdit object will be converted to PDF
before importing, and it is possible the content has multiple pages. If
the “targetIndex” argument is not specified, the content will be inserted
to the end of the document. Otherwise, the content will be inserted to the
PDF document starting from the “targetIndex” in the document, and the
previous page at the “targetIndex” will go after the content of the
RichTextEdit.
Examples
The following example inserts the RichTextEdit content to the end of
the document:
|
1 2 3 4 5 6 7 8 |
PDFdocument lpdf_doc lpdf_doc = create PDFdocument rte_1.insertdocument( "testdocument.txt", false,FileTypeText!) //Import the richtextedit content lpdf_doc.importrichtextedit( rte_1) lpdf_doc.save( "D:saveimportrichtextedit.pdf") |
The following example inserts the RichTextEdit content to the start
of the document:
|
1 2 3 4 5 6 7 8 9 10 11 |
PDFdocument lpdf_doc PDFpage lpdf_page lpdf_doc = create PDFdocument lpdf_page = create PDFpage lpdf_doc.addpage(lpdf_page) rte_1.insertdocument( "testdocument.txt", false,FileTypeText!) //Insert the richtextedit content to be the first page in the document lpdf_doc.importrichtextedit( rte_1,1) lpdf_doc.save( "D:saveimportrichtextedit.pdf") |
See also