179 | | |
180 | | Description: First scale the document to match the specified pixels per point, |
181 | | then render the rectangle given by the upper left corner at |
182 | | (src_x, src_y) and src_width and src_height. |
183 | | |
184 | | Parameters: pagenum: the page from which we are to render |
185 | | src_x: x coordinate of upper left corner |
186 | | src_y: y coordinate of upper left corner |
187 | | src_width: width of rectangle to render |
188 | | src_height: height of rectangle to render |
189 | | scale: scale specified as pixels per point |
190 | | (if isScalable() is FALSE, scale is ignored and assumed to be 1.0) |
191 | | rotation: rotate the document by the specified degree |
192 | | (allowed values are 0, 90, 180, 270) |
193 | | (if isRotable() is FALSE, rotation is ignored and assumed to be 0) |
194 | | hps: handle of presentation space into which we are to render |
195 | | rect: pointer to RECTL structure, defines render area on HPS |
196 | | errorCode: return location for an error/warning code, or NULL |
197 | | error: return location for an error/warning, or NULL |
198 | | |
199 | | Syntax: renderPageToPS( in long pagenum, in long src_x, in long src_y, |
200 | | in long src_width, in long src_height, |
201 | | in double scale, in long rotation, |
202 | | in unsigned long hps, in somMToken rect, |
203 | | out long errorCode, inout string error ); |
204 | | |
| 171 | Description: |
| 172 | First scale the document to match the specified pixels per point, then render the rectangle given by the upper left corner at (src_x, src_y) and src_width and src_height. |
| 173 | Parameters: |
| 174 | ||pagenum||the page from which we are to render|| |
| 175 | ||src_x||x coordinate of upper left corner|| |
| 176 | ||src_y||y coordinate of upper left corner|| |
| 177 | ||src_width||width of rectangle to render|| |
| 178 | ||src_height||height of rectangle to render|| |
| 179 | ||scale||scale specified as pixels per point (if isScalable() is FALSE, scale is ignored and assumed to be 1.0)|| |
| 180 | ||rotation||rotate the document by the specified degree (allowed values are 0, 90, 180, 270) (if isRotable() is FALSE, rotation is ignored and assumed to be 0)|| |
| 181 | ||hps||handle of presentation space into which we are to render|| |
| 182 | ||rect||pointer to RECTL structure, defines render area on HPS|| |
| 183 | ||errorCode||return location for an error/warning code, or NULL|| |
| 184 | ||error||return location for an error/warning, or NULL|| |
| 185 | Syntax: |
| 186 | {{{ |
| 187 | renderPageToPS( in long pagenum, in long src_x, in long src_y, |
| 188 | in long src_width, in long src_height, |
| 189 | in double scale, in long rotation, |
| 190 | in unsigned long hps, in somMToken rect, |
| 191 | out long errorCode, inout string error ); |
| 192 | }}} |
220 | | |
221 | | Description: Returns a sequence of rectangles containing the area that would |
222 | | be rendered as "selected." |
223 | | The returned sequence must be freed with freeRectangles(). |
224 | | |
225 | | Note: SOMMalloc() must be used for all memory allocations. |
226 | | |
227 | | Parameters: pagenum: page number |
228 | | selection: start and end point of selection as a rectangle |
229 | | |
230 | | Return value: A newly allocated LuRectSequence, or NULL if |
231 | | nothing is selected or the document doesn't have |
232 | | selectable text. |
233 | | Default |
234 | | return value: NULL |
235 | | |
236 | | |
237 | | Syntax: LuRectSequence *getSelectionRectangles( in long pagenum, |
238 | | in LuRectangle selection ); |
239 | | |
240 | | |
| 208 | Description: |
| 209 | Returns a sequence of rectangles containing the area that would be rendered as "selected." The returned sequence must be freed with [#freeRectangles freeRectangles()]. |
| 210 | Parameters: |
| 211 | ||pagenum||page number|| |
| 212 | ||selection||start and end point of selection as a rectangle|| |
| 213 | Return value: |
| 214 | A newly allocated LuRectSequence, or NULL if nothing is selected or the document doesn't have selectable text. |
| 215 | Default return value: |
| 216 | NULL |
| 217 | Note: |
| 218 | SOMMalloc() must be used for all memory allocations. |
| 219 | Syntax: |
| 220 | {{{LuRectSequence *getSelectionRectangles( in long pagenum, in LuRectangle selection );}}} |
| 221 | |
| 222 | [=#freeRectangles ] |
250 | | |
251 | | Description: Retrieves the contents of the specified rectangle as text. |
252 | | |
253 | | Parameters: pagenum: page number |
254 | | selection: the rectangle including the text |
255 | | |
256 | | Return value: A pointer to the contents of the rectangle |
257 | | as a string or NULL. |
258 | | The pointer is valid until next getText() call, |
259 | | or until LuDocument object is destroyed. |
260 | | Default |
261 | | return value: NULL |
262 | | |
263 | | Note: Charset of returned string must be UTF-8 |
264 | | |
265 | | string: getText( in long pagenum, in LuRectangle selection ); |
266 | | |
| 232 | Description: |
| 233 | Retrieves the contents of the specified rectangle as text. |
| 234 | Parameters: |
| 235 | ||pagenum||page number|| |
| 236 | ||selection||the rectangle including the text|| |
| 237 | Return value: |
| 238 | A pointer to the contents of the rectangle as a string or NULL. The pointer is valid until next getText() call, or until LuDocument object is destroyed. |
| 239 | Default return value: |
| 240 | NULL |
| 241 | Note: |
| 242 | Charset of returned string must be UTF-8 |
| 243 | Type: |
| 244 | string |
| 245 | Syntax: |
| 246 | {{{getText( in long pagenum, in LuRectangle selection );}}} |
281 | | |
282 | | Description: Returns a sequence of LuLinkMapping items. |
283 | | This sequence must be freed |
284 | | with freeLinkMapping() when done. |
285 | | |
286 | | Parameters: pagenum: page number |
287 | | |
288 | | Return value: A pointer to sequence of LuLinkMapping. |
289 | | Default |
290 | | return value: A pointer to an empty LuLinkMapSequence. |
291 | | |
292 | | Note: SOMMalloc() must be used for all memory allocations. |
293 | | |
294 | | Syntax: LuLinkMapSequence *getLinkMapping( in long pagenum ); |
295 | | |
296 | | |
| 262 | Description: |
| 263 | Returns a sequence of LuLinkMapping items. This sequence must be freed with [#freeLinkMapping freeLinkMapping()] when done. |
| 264 | Parameters: |
| 265 | ||pagenum||page number|| |
| 266 | Return value: |
| 267 | A pointer to sequence of LuLinkMapping. |
| 268 | Default return value: |
| 269 | A pointer to an empty LuLinkMapSequence. |
| 270 | Note: |
| 271 | SOMMalloc() must be used for all memory allocations. |
| 272 | Syntax: |
| 273 | {{{LuLinkMapSequence *getLinkMapping( in long pagenum );}}} |
| 274 | |
| 275 | [=#freeLinkMapping ] |
349 | | |
350 | | Description: Create a new postscript file and generate the document to it. |
351 | | |
352 | | Parameters: filename: the path of the output filename |
353 | | first_page: the first page to print |
354 | | last_page: the last page to print |
355 | | width: the paper width in 1/72 inch |
356 | | height: the paper height in 1/72 inch |
357 | | (These values will end up in the DocumentMedia, the |
358 | | BoundingBox DSC comments, and other places in the |
359 | | generated PostScript.) |
360 | | brkExport: pointer to boolean variable which must be checked |
361 | | during generating postscript, if it's TRUE - interrupt |
362 | | generation process. |
363 | | |
364 | | Return value: TRUE if PS document was generated successfully or |
365 | | generation was interrupted, FALSE otherwise. |
366 | | Default |
367 | | return value: FALSE |
368 | | |
369 | | Syntax: exportToPostScript( in string filename, |
370 | | in long first_page, in long last_page, |
371 | | in double width, in double height, |
372 | | inout boolean brkExport ); |
373 | | |
| 326 | Description: |
| 327 | Create a new postscript file and generate the document to it. |
| 328 | Parameters: |
| 329 | ||filename||the path of the output filename|| |
| 330 | ||first_page||the first page to print|| |
| 331 | ||last_page||the last page to print|| |
| 332 | ||width||the paper width in 1/72 inch|| |
| 333 | ||height||the paper height in 1/72 inch|| |
| 334 | ||brkExport||pointer to boolean variable which must be checked during generating postscript; if TRUE, interrupt generation process.|| |
| 335 | Return value: |
| 336 | TRUE if PS document was generated successfully or generation was interrupted, FALSE otherwise. |
| 337 | Default return value: |
| 338 | FALSE |
| 339 | Note: |
| 340 | Values for width and height will end up in the DocumentMedia, the BoundingBox DSC comments, and other places in the generated PostScript. |
| 341 | Syntax: |
| 342 | {{{ |
| 343 | exportToPostScript( in string filename, |
| 344 | in long first_page, in long last_page, |
| 345 | in double width, in double height, |
| 346 | inout boolean brkExport ); |
| 347 | }}} |
426 | | |
427 | | Description: Certain documents have an index associated with them. |
428 | | This index can be used to help the user navigate the document, |
429 | | and is similar to a table of contents. Each node in the index will |
430 | | contain a LuLink which can be displayed to the user. |
431 | | |
432 | | Here is a simple example of some code that walks the full index: |
433 | | |
434 | | void viewTree( int level, LuIndexNode *n ) |
435 | | { |
436 | | if ( n == NULL ) { |
437 | | return; |
438 | | } |
439 | | |
440 | | somLPrintf( level, "title: %s\n", n->getLink(ev)->title ); |
441 | | |
442 | | LuIndexNode *cn = n->getFirstChild( ev ); |
443 | | while ( cn != NULL ) { |
444 | | viewTree( level + 1, cn ); |
445 | | cn = n->getNextChild( ev ); |
446 | | } |
447 | | } |
448 | | |
449 | | Return value: A new LuIndexNode, which represents an index root, |
450 | | or NULL, if the document doesn't have an index. |
451 | | Default |
452 | | return value: NULL |
453 | | |
454 | | Syntax: LuIndexNode getIndex(); |
455 | | |
456 | | |
| 399 | Description: |
| 400 | Certain documents have an index associated with them. This index can be used to help the user navigate the document, and is similar to a table of contents. Each node in the index will contain a LuLink which can be displayed to the user. |
| 401 | |
| 402 | Here is a simple example of some code that walks the full index: |
| 403 | {{{ |
| 404 | void viewTree( int level, LuIndexNode *n ) |
| 405 | { |
| 406 | if ( n == NULL ) { |
| 407 | return; |
| 408 | } |
| 409 | |
| 410 | somLPrintf( level, "title: %s\n", n->getLink(ev)->title ); |
| 411 | |
| 412 | LuIndexNode *cn = n->getFirstChild( ev ); |
| 413 | while ( cn != NULL ) { |
| 414 | viewTree( level + 1, cn ); |
| 415 | cn = n->getNextChild( ev ); |
| 416 | } |
| 417 | } |
| 418 | }}} |
| 419 | Return value: |
| 420 | A new LuIndexNode, which represents an index root, or NULL, if the document doesn't have an index. |
| 421 | Default return value: |
| 422 | NULL |
| 423 | Syntax: |
| 424 | {{{LuIndexNode getIndex();}}} |
| 425 | |
| 426 | [=#getDocumentInfo ] |
483 | | |
484 | | Description: Returns TRUE if the page has a thumbnail associated with it. It also |
485 | | fills the width and height with the those of the thumbnail. |
486 | | The values of width and height are not changed if no |
487 | | appropriate thumbnail exists. |
488 | | |
489 | | Parameters: pagenum: page number |
490 | | suggested_width: if thumbnail doesn't have a predefined width, |
491 | | it will be created with suggested_width. |
492 | | width: value for width |
493 | | height: value for height |
494 | | |
495 | | Return value: TRUE, if the page has a thumbnail associated with it, FALSE otherwise. |
496 | | Default |
497 | | return value: FALSE |
498 | | |
499 | | Syntax: getThumbnailSize( in long pagenum, in short suggested_width, inout short width, inout short height ); |
500 | | |
| 449 | Description: |
| 450 | Returns TRUE if the page has a thumbnail associated with it. It also fills the width and height with the those of the thumbnail. The values of width and height are not changed if no appropriate thumbnail exists. |
| 451 | Parameters: |
| 452 | ||pagenum||page number|| |
| 453 | ||suggested_width||if thumbnail doesn't have a predefined width, it will be created with suggested_width.|| |
| 454 | ||width||value for width|| |
| 455 | ||height||value for height|| |
| 456 | Return value: |
| 457 | TRUE, if the page has a thumbnail associated with it, FALSE otherwise. |
| 458 | Default return value: |
| 459 | FALSE |
| 460 | Syntax: |
| 461 | {{{getThumbnailSize( in long pagenum, in short suggested_width, inout short width, inout short height );}}} |
503 | | |
504 | | Description: Returns pointer to LuPixbuf |
505 | | |
506 | | Parameters: pagenum: page number |
507 | | suggested_width: if thumbnail doesn't have a predefined width, |
508 | | it will be created with suggested_width. |
509 | | |
510 | | Return value: pointer to LuPixbuf, if page has a thumbnail associated with it, |
511 | | or NULL. |
512 | | Default |
513 | | return value: NULL |
514 | | |
515 | | Syntax: LuPixbuf getThumbnail( in long pagenum, in short suggested_width ); |
516 | | |
517 | | |
518 | | |
| 464 | Description: |
| 465 | Returns pointer to LuPixbuf. |
| 466 | Parameters: |
| 467 | ||pagenum||page number|| |
| 468 | ||suggested_width||if thumbnail doesn't have a predefined width, it will be created with suggested_width.|| |
| 469 | Return value: |
| 470 | Pointer to LuPixbuf, if page has a thumbnail associated with it, or NULL. |
| 471 | Default return value: |
| 472 | NULL |
| 473 | Syntax: |
| 474 | {{{LuPixbuf getThumbnail( in long pagenum, in short suggested_width );}}} |
| 475 | |
| 476 | [=#searchText ] |
520 | | |
521 | | Description: Returns a sequence of rectangles for each occurrence of the text |
522 | | found on the page. |
523 | | The returned sequence must be freed with freeRectangles() |
524 | | |
525 | | Parameters: pagenum: page number |
526 | | text: the text to find (in system encoding) |
527 | | |
528 | | Return value: A newly allocated LuRectSequence, or NULL if nothing found |
529 | | Default |
530 | | return value: NULL |
531 | | |
532 | | Note: SOMMalloc() must be used for all memory allocations. |
533 | | |
534 | | Syntax: LuRectSequence *searchText( in long pagenum, in string text, |
535 | | in boolean caseSensitive, in boolean findBack ); |
536 | | |
| 478 | Description: |
| 479 | Returns a sequence of rectangles for each occurrence of the text found on the page. The returned sequence must be freed with [#freeRectangles freeRectangles()]. |
| 480 | Parameters: |
| 481 | ||pagenum||page number|| |
| 482 | ||text||the text to find (in system encoding)|| |
| 483 | Return value: |
| 484 | A newly allocated LuRectSequence, or NULL if nothing found |
| 485 | Default return value: |
| 486 | NULL |
| 487 | Note: |
| 488 | SOMMalloc() must be used for all memory allocations. |
| 489 | Syntax: |
| 490 | {{{ |
| 491 | LuRectSequence *searchText( in long pagenum, in string text, |
| 492 | in boolean caseSensitive, in boolean findBack ); |
| 493 | }}} |
563 | | |
564 | | Description: Returns a sequence of LuInputField items that may be used to enter |
565 | | data into the document. |
566 | | This sequence must be freed with freeInputFields() when done. |
567 | | |
568 | | Parameters: pagenum: page number |
569 | | |
570 | | Return value: A pointer to sequence of valid LuInputField items. |
571 | | Default |
572 | | return value: A pointer to an empty LuInputFieldSequence. |
573 | | |
574 | | Note: The returned sequence must be allocated with SOMMalloc(), |
575 | | each element must be a newly created SOM object. |
576 | | |
577 | | Syntax: {{{LuInputFieldSequence *getInputFields( in long pagenum );}}} |
578 | | |
579 | | |
| 521 | Description: |
| 522 | Returns a sequence of LuInputField items that may be used to enter data into the document. This sequence must be freed with [#freeInputFields freeInputFields()] when done. |
| 523 | Parameters: |
| 524 | ||pagenum||page number|| |
| 525 | Return value: |
| 526 | A pointer to sequence of valid LuInputField items. |
| 527 | Default return value: |
| 528 | A pointer to an empty LuInputFieldSequence. |
| 529 | Note: |
| 530 | The returned sequence must be allocated with SOMMalloc(), each element must be a newly created SOM object. |
| 531 | Syntax: |
| 532 | {{{LuInputFieldSequence *getInputFields( in long pagenum );}}} |
| 533 | |
| 534 | [=#freeInputFields ] |