ONO::FW::Apps::Core::Graphics

This module offers a number of PDF generation helpers for ONO apps.

Functions

image_ids();

Default list of Morzino Picture Dictionary IDs that may be used in ONO apps.

ONO::FW::Apps::Core::Graphics->image_ids( );

mkpdf();

Generate a PDF file via ONO app - start.

ONO::FW::Apps::Core::Graphics->mkpdf( $BLK_ref, $vars_ref, $HTTP, $BASE );

output_paper();

Generate a PDF file via ONO app - finish.

Switches:

Simply transmitted to ONO_FW_Edu_PDF_please_wait, adding switch -I, see please_wait function for details.

ONO::FW::Apps::Core::Graphics->output_paper( $pdfkey, $BLK_ref, $vars_ref, $HTTP, $BASE, $switches );

pdf_black();

Generate black (dark) color.

ONO::FW::Apps::Core::Graphics->pdf_black( );
returns: "0:$r1:$r1:$r1"

pdf_draw_house();

Draw a house image.

Switches:

-i image mode (first row is much higher)

ONO::FW::Apps::Core::Graphics->pdf_draw_house( $canvas, $x, $y, $cols, $res, $op, $offset, $corr, $switches );
returns: ""

pdf_draw_item_number();

Draw a single item number on a sheet.

Switches:

-a auto mode,
-A like -a, but also max = 4
-C correction mode (b/w)
-f force mode
-F five mode: only display if num / 5 is zero
-W override in worksheet maker mode
-y pdf_y auto detect mode, sets number based on y coordinate,
this works with both 3 and 4 rows using approximation...

ONO::FW::Apps::Core::Graphics->pdf_draw_item_number( $canvas, $pdf_x, $pdf_y, $num, $switches, $vars_ref );

pdf_draw_item_number_html();

Draw item number - HTML version.

ONO::FW::Apps::Core::Graphics->pdf_draw_item_number_html( );
returns: qq~<div class="p2 radius$_[1]" style="background-color:#ffddbb"><div class="block$_[1] radius$_[1] xsmall bold cole center" style="background-color:#dd6611;line-height:16px">$_[2]</div></div>~

pdf_draw_item_number_html_example_mini();

Draw item number - HTML version, smaller.

ONO::FW::Apps::Core::Graphics->pdf_draw_item_number_html_example_mini( );
returns: qq~<td>(</td>$RENUM<td>)</td>~

pdf_draw_item_numbers();

Draw item numbers on a sheet.

Switches:

-C correction mode (b/w)
-d lower lines 1/2
-D lower lines 2/2
-f force (same as -F, but compatible with pdf_draw_item_number)
-F force (same as -f, but will only work in "five div mode")
-H horizontal line
-l print half last line if app_input_result_hints
-L don't print last item if app_input_result_hints
-S start with Second item (1234 -> .123)
-V vertical line
-W Worksheet Builder mode, will respect the custom layout logic,
using vars worksheet_builder_layout

ONO::FW::Apps::Core::Graphics->pdf_draw_item_numbers( $canvas, $pdf_x, $pdf_y, $start, $nums, $switches, $vars_ref );

pdf_draw_result_hints();

Draw result hints.

Switches:

-b bold
-d text down / lower (0.5 mm)
-D text down / lower (1 mm)
-E don't display empty boxes (will still display zero results)
-l font larger (14)
-L font x-large (16)
-n font normal size (12)
-u text up / higher (0.5 mm)
-U text up / higher (1 mm)
-Z don't display zero results

ONO::FW::Apps::Core::Graphics->pdf_draw_result_hints( $canvas, $x, $y, $width, $height, $items_x, $items_y, $res_ref, $switches, $comma );

pdf_draw_result_hints_resblock();

Draw a result hints block.

ONO::FW::Apps::Core::Graphics->pdf_draw_result_hints_resblock( $res_ref, $b1, $b2 );
returns: @block

pdf_draw_stepcalc();

Draw a step-calc image.

type can be "boxes", "arrows" or "numline"

Switches:

-B black & white (greyscale)

ONO::FW::Apps::Core::Graphics->pdf_draw_stepcalc( $canvas, $pdf_x, $pdf_y, $type, $size, $op, $nums_ref, $switches );

pdf_draw_wall();

Draw a wall image.

op - add, sub, corr

Switches:

-W less wide (12.5 instead of 15 mm)

ONO::FW::Apps::Core::Graphics->pdf_draw_wall( $canvas, $x, $y, $rows, $nums_ref, $op, $numsys, $mode, $vars_ref, $num_comma, $switches );

pdf_grey();

Generate grey color.

ONO::FW::Apps::Core::Graphics->pdf_grey( );
returns: "0:$r1:$r1:$r1"

Sub-Modules

none

Dependencies

Code