GetOverflowPageText
PowerScript function
Description
Returns the overflow content of the PDFRichText/PDFMultilineText
object that cannot display in the current page.
Applies to
PDFMultilineText object in Objects and Controls
PDFRichText object in Objects and Controls
Syntax
|
1 |
PDFSharedText GetOverflowPageText() |
Return value
PDFSharedText object in Objects and Controls. Returns a
PDFSharedText object that carries the overflow content if the
PDFRichText/PDFMultilineText object cannot display in the current page,
and returns null if the PDFRichText/PDFMultilineText object can all
display in the page.
Usage
The two functions, IsOverflowPage and GetOverflowPageText, shall
work together to ensure proper paging of the PDFRichText/PDFMultilineText
in the PDF document. By calling the function IsOverflowPage, you find out
whether the content overflow. If the returned result is True, the
GetOverflowPageText function gets the overflow content, which can be
loaded into the next page. You can call the functions in a loop until the
function IsOverflowPage finally returns False.
PDFSharedText is only for use with PDFMultilineText and PDFRichText
objects, for adding the overflow text into a new page.
Example
This example checks whether paging is needed for the PDFRichText
object by calling the IsOverflowPage. If the returned result is true, call
GetOverflowPageText to load the overflow content in a new page:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
PDFdocument lpdf_doc PDFpage lpdf_page PDFrichtext lpdf_rtext PDFcolor lpdf_color PDFsharedtext lpdf_stext string ssText integer fhandle; long fileLen; long readSize lpdf_doc = create PDFdocument lpdf_page = create PDFpage lpdf_rtext = create PDFrichtext lpdf_rtext.width = lpdf_page.getwidth( ) //Read a file from the current directory fileLen = FileLength64("testdocument.txt") fhandle = fileopen("testdocument.txt", textMode! ) blob readByte readSize = fileReadEx(fhandle, readByte, fileLen) ssText = string(readByte) fileclose(fhandle) lpdf_rtext.addtextblock(ssText ) lpdf_page.addcontent( lpdf_rtext) lpdf_doc.addpage( lpdf_page) //Check whether paging is needed by isoverflowpage do while lpdf_rtext.isoverflowpage( ) //Get the overflow content lpdf_stext = lpdf_rtext.getoverflowpagetext( ) lpdf_page = create pdfpage lpdf_page.AddContent(lpdf_stext) lpdf_doc.addPage( lpdf_page) loop lpdf_doc.save( "D:saveoverflowpage_richtext.pdf") |
This example checks whether paging is needed for the
PDFMultilineText object by calling the IsOverflowPage. If the returned
result is true, call GetOverflowPageText to load the overflow content in a
new page:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
PDFdocument lpdf_doc PDFpage lpdf_page PDFmultilinetext lpdf_mtext lpdf_doc = create PDFdocument lpdf_page = create PDFpage lpdf_mtext = create PDFmultilinetext lpdf_mtext.width = lpdf_page.getwidth( ) string ssText integer fhandle; long fileLen; long readSize PDFsharedtext lpdf_stext lpdf_doc = create PDFdocument lpdf_page = create PDFpage lpdf_mtext = create PDFmultilinetext lpdf_mtext.width = 100 lpdf_mtext.height= 100 fileLen = FileLength64("testdocument.txt") fhandle = fileopen("testdocument.txt", textMode! ) blob readByte readSize = fileReadEx(fhandle, readByte, fileLen) ssText = string(readByte) fileclose(fhandle) lpdf_mtext.content = ssText lpdf_page.addcontent( lpdf_mtext) lpdf_doc.addpage( lpdf_page) //isoverflowpage do while lpdf_mtext.isoverflowpage( ) //getoverflowpagetext lpdf_stext = lpdf_mtext.getoverflowpagetext( ) lpdf_stext.height=100 lpdf_page = create pdfpage lpdf_page.AddContent(lpdf_stext) lpdf_doc.addPage( lpdf_page) loop lpdf_doc.settableofcontents( lpdf_toc) lpdf_doc.save( "saveoverflowpage.pdf") |
See also
PDFMultilineText objects:
PDFRichText objects: