Packageindex Classtrees Modulegroups Elementlist Report XML Files

pc4p

pc4p_main

pc4p_main

private class pc4p_main

In this object, everything concerning the main setup of a PDF is contained. Most important is the pdf-pointer, of course, which is handled down to every child in this PDF.

AuthorsAlexander Wirtz <alex@pc4p.net>
Version$Id: pc4p_main.html,v 1.19.2.1 2002/08/12 22:47:08 eru Exp $

 

Public Method Summary

void pc4p_set_savepdf(string $save_pdf, [ string $filename ])
Set the behaviour of the output
void pc4p_set_newpage(mixed $newpage)
Changes the behaviour after a pagebreak
void pc4p_draw()
Draw-Function for the PDF
void pc4p_set_info(array $info_array)
Sets the info values for the PDF
void pc4p_set_resourcefile(string $rfile)
Sets the resourcefile
void pc4p_set_compatibility([ string $comp ])
Sets the version of Acrobat
void pc4p_set_tempfile([ string $path ])
Enables PC4P to use a temporyfile not the memory for PDF creation
void pc4p_set_serial(string $serial)
Sets the serial string
void pc4p_set_compression(integer $compression)
Sets the compression-parameter

Private Method Summary

void pc4p_main()
pc4p_main constructor
void pc4p_open_pdf()
Opens the PDF object
mixed pc4p_check_color([ string $color, string $type ])
Check if a color is standard or custom
void pc4p_draw_children()
Topmost draw-children function

Private Field Summary

array $children
Array of all children of this object
integer $pdfp
PDF-Pointer used for all pdf_*
boolean $pdf_opened
Is the PDF opened?
string $filename
Name of the PDF-File
string $save_pdf
Shall the PDF be saved, or viewed?
string $tempfile
Path to the tempfile
object pc4p_page $curr_page
Pointer to the current page, used when walking through $children
object pc4p_page $next_page
Pointer to the next page, used when walking through $children
integer $newpage
Should PC4P always create a new page on pagebreak?
array $info_array
Saves the info-array, if we're still in object scope
integer $compression
Saves the compression, if we're still in object scope
array $fonts
As there are no static members, I use a central array to store the fonts
array $bookmarks
As there are no static members, I use a central array to store the already allocated bookmarks
integer $bookmark_identifier
As there are no static members, I use a central variable to store the current bookmark identifier

Public Method Details

pc4p_set_savepdf

public void pc4p_set_savepdf(string $save_pdf, [ string $filename ])

  If you want to make a direct save, or if you want to change the filename, this is the function you should use

Parameter
string $save_pdf
"inline", "attached", "drive", or the first char of these
string $filename = >>""<<
When saving on a drive, with leading directories, else without
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_newpage

public void pc4p_set_newpage(mixed $newpage)

  Sets if a new page after a pagebreak shall be created, or if an already created page shall be used

Parameter
mixed $newpage
"yes", "y", 1 - take your pick, anything that looks true will force a newpage
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_draw

public void pc4p_draw()

  Calls the draw for each child, closes PDF Document, then makes a get_buffer on the PDF-Document, to hand it to the browser. If PC4PDEBUG is set, the Object-Tree is printed. Called as last function in the class.

Returns void

See Also pc4p_main::pc4p_draw_children()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_info

public void pc4p_set_info(array $info_array)

  Here, you can handle some general information to the PDF. You can have a look at it, if you use the Acrobat-Reader and select the general options of a file.

Parameter
array $info_array
Contains the fields and their values. Standard Fields: Subject, Title, Creator, Author, Keywords
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_resourcefile

public void pc4p_set_resourcefile(string $rfile)

  If you need customized fonts, you must define a resourcefile, usually it's called pdflib.upr

Parameter
string $rfile
Complete path for the resourcefile
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_compatibility

public void pc4p_set_compatibility([ string $comp ])

  This function controls the version of Acrobat you will use in this PDF. You can set it to version 3, 4 or 5.

Parameter
string $comp = >>"1.3"<<
"1.2", "1.3" or "1.4" for Acrobat 3, 4 or 5
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_tempfile

public void pc4p_set_tempfile([ string $path ])

  Use this function to create your PDFs with temporary files. Function expects a valid path, where you have write-access

Parameter
string $path = >>"/tmp"<<
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_serial

public void pc4p_set_serial(string $serial)

  If you have bought a license of the PDFlib, you can set the serial with this function

Parameter
string $serial
The serial for your copy of the PDFlib
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_compression

public void pc4p_set_compression(integer $compression)

  PDFs with versionnumber >= 4 can have a compression-factor. Use this function to enable compression for your PDF.

Parameter
integer $compression
Valid range is from 0 to 9
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

Private Method Details

pc4p_main

private void pc4p_main()

  Initializes the filepointer required for apprehending the PDF-Pointer, which is initialized also

Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_open_pdf

private void pc4p_open_pdf()

  Gets called from pc4p_page, opens a PDF object in buffer or as a file, sets the info and compression

Returns void

See Also pc4p_main::pc4p_set_info()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_check_color

private mixed pc4p_check_color([ string $color, string $type ])

  This function checks, if the color is one of the 16 standardcolors from HTML or if it is in the hex-notation #rrggbb. If the color fits one of these schemes, the color is returned, otherwise the function returns black.

Parameter
string $color = >>""<<
You can use one of the 16 standardcolors from HTML or the hex-notation (#rrggbb)
string $type = >>"line"<<
What do you want to check, linecolor or fillcolor? Different returntype if color isn't found!!! (Input: "line" or "fill" )
Returns mixed $color

The color in percentage of each colorchannel

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_draw_children

private void pc4p_draw_children()

  Calls the draw function for each child in the children-array

Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

Private Field Details

$children

private array $children

>>array()<<


$pdfp

private integer $pdfp

>><<


$pdf_opened

private boolean $pdf_opened

>>false<<


$filename

private string $filename

>>"pc4p.pdf"<<


$save_pdf

private string $save_pdf

>>"i"<<


$tempfile

private string $tempfile

>>""<<


$curr_page

private object pc4p_page $curr_page

>><<


$next_page

private object pc4p_page $next_page

>><<


$newpage

private integer $newpage

>><<


$info_array

private array $info_array

>><<


$compression

private integer $compression

>><<


$fonts

private array $fonts

>>array()<<


$bookmarks

private array $bookmarks

>>array( 0 => 0 )<<


$bookmark_identifier

private integer $bookmark_identifier

>>1<<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Tue, 13 Aug 2002 00:43:10 +0200 by PHPDoc v1.5 www.phpdoc.de