From 02608271bb2a9f3a65ed536984d306ee14b48e34 Mon Sep 17 00:00:00 2001 From: Geo Halkiadakis Date: Sun, 12 Jul 2026 15:51:52 +0300 Subject: initialize repository; add docker config; migrate configuration to new specs --- public/xx-prn.php | 338 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 338 insertions(+) create mode 100644 public/xx-prn.php (limited to 'public/xx-prn.php') diff --git a/public/xx-prn.php b/public/xx-prn.php new file mode 100644 index 0000000..7b7ef95 --- /dev/null +++ b/public/xx-prn.php @@ -0,0 +1,338 @@ +Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false); + // Set font + $this->SetFont('ubuntuv14400', '', 9); + // Title + $this->Cell(0, 15, 'ΚΑΛΛΑΣΣΑ Project '.$str, 0, false, 'R', 0, '', 0, false, 'M', 'M'); + } + + // Page footer + public function Footer() { + // Position at 15 mm from bottom + $this->SetY(-15); + // Set font + $this->SetFont('ubuntuv14400', '', 9); + // Page number + // $this->Cell(0, 15, '— '.$this->getAliasNumPage().' /'.$this->getAliasNbPages().' —', 0, false, 'C', 0, '', 0, false, 'T', 'M'); + $this->Cell(0, 15, '— '.$this->getAliasNumPage().' —', 0, false, 'C', 0, '', 0, false, 'T', 'M'); + } +} + +// create new PDF document +// $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); + +// set document information +$pdf->SetCreator(PDF_CREATOR); +$pdf->SetAuthor(PDF_AUTHOR); +$pdf->SetTitle('Kallasha Project'); +$pdf->SetSubject('Kallasha items'); +$pdf->SetKeywords('Kallasha, File, Tradition'); + + +// $Ubuntu400font = TCPDF_FONTS::addTTFfont(dirname(__FILE__).'/library/TCPDF/fonts/pi-fonts/ubuntu-v14-400.ttf', 'TrueTypeUnicode', '', 32); +// $Ubuntu700font = TCPDF_FONTS::addTTFfont(dirname(__FILE__).'/library/TCPDF/fonts/pi-fonts/ubuntu-v14-700.ttf', 'TrueTypeUnicode', '', 32); + +// set default header data +// $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING); +$pdf->SetHeaderData('', 0, '', ''); + +// set header and footer fonts +$pdf->setHeaderFont(Array('ubuntuv14400', '', PDF_FONT_SIZE_MAIN)); +$pdf->setFooterFont(Array('ubuntuv14400', '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font +$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +// set margins +$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); +$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); +$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +// set auto page breaks +$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +// set image scale factor +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +// set some language-dependent strings (optional) +if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { + require_once(dirname(__FILE__).'/lang/eng.php'); + $pdf->setLanguageArray($l); +} + +// --------------------------------------------------------- + +$pdf->AddPage(); + +$pdf->SetFont('ubuntuv14400', '', 44, '', false); +$pdf->SetY(150); +$html = '

Kallasha project

'; +$pdf->writeHTML($html, true, false, true, false, ''); + +$pdf->SetFont('ubuntuv14400', '', 24, '', false); +$pdf->SetY(170); +$html = '

Κατάλογος Αντικειμένων

'; +$pdf->writeHTML($html, true, false, true, false, ''); + +$pdf->AddPage(); + +// --------------------------------------------------------- + +// set font +// $pdf->SetFont('dejavusans', '', 10); +$pdf->SetFont('ubuntuv14400', '', 9, '', false); + +// add a page +$pdf->AddPage(); + +// writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='') +// writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true) + +// create some HTML content +$html = '

HTML Example 1

+Some special characters: < € € € & è è © > \\slash \\\\double-slash \\\\\\triple-slash +

Αριθμημένη Λίστα

+List example: +
    +
  1. Από την πόρτα σου περνώ
  2. +
  3. Βήχω και ξεροβήχω
  4. +
  5. underlined text
  6. +
  7. bbibiubib
  8. +
  9. link to http://www.tecnick.com
  10. +
  11. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
    Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
  12. +
  13. TEST line through
  14. +
  15. font + 3
  16. +
  17. small text normal small text normal subscript normal superscript normal
  18. +
+
+
Coffee
+
Black hot drink
+
Milk
+
White cold drink
+
+
IMAGES
+test alt attribute +
'; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +$html = '

Example 2

+

Σημεία χωρίς αρίθμηση

+ +'; + +$pdf->writeHTML($html, true, false, true, false, ''); + +// output some RTL HTML content +$html = '
The words “מזל [mazel] טוב [tov]” mean “Congratulations!”
'; +$pdf->writeHTML($html, true, false, true, false, ''); + +// test some inline CSS +$html = '

This is just an example of html code to demonstrate some supported CSS inline styles. +bold text +line-trough +underline and line-trough +color +background color +bold +xx-small +x-small +small +medium +large +x-large +xx-large +

'; + +$pdf->writeHTML($html, true, false, true, false, ''); + +// reset pointer to the last page +$pdf->lastPage(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Print a table + +// add a page +$pdf->AddPage(); + + +$html = '

HTML TABLE:

+ + + + + + + + + + + + + + +
LEFT alignRIGHT align
A1 example link column span. One two tree four five six seven eight nine ten.
line after br
small text normal subscript normal superscript normal bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  1. first
    1. sublist
    2. sublist
  2. second
small small small small small small small small small small small small small small small small small small small small
abcd4C
'; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// Print some HTML Cells + +$html = 'red pi green blue
red green blue'; + +$pdf->SetFillColor(255,255,0); + +$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 0, true, 'L', true); +$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 1, true, 'C', true); +$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 0, true, 'R', true); + +// reset pointer to the last page +$pdf->lastPage(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Print a table + +// add a page +$pdf->AddPage(); + +// create some HTML content +$html = '

Image alignments on HTML table

+ + + + + + + + +
'; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// reset pointer to the last page +$pdf->lastPage(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Print all HTML colors + +// add a page +$pdf->AddPage(); + +$textcolors = '

HTML Text Colors

'; +$bgcolors = '

HTML Background Colors

'; + +foreach(TCPDF_COLORS::$webcolor as $k => $v) { + $textcolors .= ''.$v.' '; + $bgcolors .= ''.$v.' '; +} + +// output the HTML content +$pdf->writeHTML($textcolors, true, false, true, false, ''); +$pdf->writeHTML($bgcolors, true, false, true, false, ''); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// Test word-wrap + +// create some HTML content +$html = '
+

Various tests

+link to page 2
+thisisaverylongword thisisanotherverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword thisisanotherverylongword thisisaverylongword'; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// Test fonts nesting +$html1 = 'Default Courier Helvetica Times dejavusans Times Helvetica Courier Default'; +$html2 = 'small text normal small text normal subscript normal superscript normal'; +$html3 = 'The quick brown fox jumps over the lazy dog.'; + +$html = $html1.'
'.$html2.'
'.$html3.'
'.$html3.'
'.$html2; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// test pre tag + +// add a page +$pdf->AddPage(); + +$html = << +Hello World!
+Hello + +
+int main() {
+    printf("HelloWorld");
+    return 0;
+}
+
+Monospace font, normal font, monospace font, normal font. +
+
DIV LEVEL 1
DIV LEVEL 2
DIV LEVEL 1
+
+SPAN LEVEL 1 SPAN LEVEL 2 SPAN LEVEL 1 +EOF; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// test custom bullet points for list + +// add a page +$pdf->AddPage(); + +$html = <<Test custom bullet image for list items +
    +
  • test custom bullet image
  • +
  • test custom bullet image
  • +
  • test custom bullet image
  • +
  • test custom bullet image
  • +
      +EOF; + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// reset pointer to the last page +$pdf->lastPage(); + +// --------------------------------------------------------- + +//Close and output PDF document +$pdf->Output('example_006.pdf', 'I'); + +//============================================================+ +// END OF FILE +//============================================================+ -- cgit v1.2.3