10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In the first call to PDF_fill_textblock( ) within a chain of linked blocks a value of -1 (inPHP: 0) must be supplied for the textflowhandle option. The Textflow handle createdinternally will be returned by PDF_fill_textblock( ), and must be stored by the user.> In the next call the Textflow handle returned in the previous step can be supplied tothe textflowhandle option (the text supplied in the text parameter will be ignored inthis case, and should be empty). The block will be filled with the remainder of theTextflow.> This process can be repeated with more Textflow blocks.> The returned Textflow handle can be supplied to PDF_info_textflow( ) in order to determinethe results of block filling, e.g. the end condition or the end position of thetext.Note that the fitmethod property should be set to clip (this is the default anyway if textflowhandleis supplied). The basic code skeleton for linking Textflow blocks looks as follows:p.fit_pdi_page(page, 0.0, 0.0, "");tf = -1;for (i = 0; i < blockcount; i++){String optlist = "encoding=winansi textflowhandle=" + tf;tf = p.fill_textblock(page, blocknames[i], text, optlist);text = null;if (tf == -1)break;/* check result of most recent call to fit_textflow() */reason = (int) p.info_textflow(tf, "returnreason");result = p.get_parameter("string", (float) reason);}/* end loop if all text was placed */if (result.equals("_stop")){p.delete_textflow(tf);break;}Cookbook A full code sample can be found in the Cookbook topic blocks/linked_textblocks.10.4 Filling PDFlib Blocks with PPS 239

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!