Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
require_once(dirname(__FILE__).'/../config.inc.php');
4
require_once(HTML2PS_DIR.'pipeline.class.php');
5
require_once(HTML2PS_DIR.'fetcher.url.class.php');
6
parse_config_file(HTML2PS_DIR.'html2ps.config');
7
 
8
$g_config = array(
9
                  'cssmedia'     => 'screen',
10
                  'renderimages' => true,
11
                  'renderforms'  => false,
12
                  'renderlinks'  => true,
13
                  'mode'         => 'html',
14
                  'debugbox'     => false,
15
                  'draw_page_border' => false
16
                  );
17
 
18
$media = Media::predefined('A4');
19
$media->set_landscape(false);
20
$media->set_margins(array('left'   => 0,
21
                          'right'  => 0,
22
                          'top'    => 0,
23
                          'bottom' => 0));
24
$media->set_pixels(1024);
25
 
26
$g_px_scale = mm2pt($media->width() - $media->margins['left'] - $media->margins['right']) / $media->pixels;
27
$g_pt_scale = $g_px_scale * 1.43;
28
 
29
$pipeline = new Pipeline;
30
$pipeline->configure($g_config);
31
$pipeline->fetchers[]     = new FetcherURL;
32
$pipeline->data_filters[] = new DataFilterHTML2XHTML;
33
$pipeline->parser         = new ParserXHTML;
34
$pipeline->layout_engine  = new LayoutEngineDefault;
35
$pipeline->output_driver  = new OutputDriverFPDF($media);
36
$pipeline->destination    = new DestinationFile(null);
37
 
38
$pipeline->process('http://localhost:81/testing/ww.html', $media);
39
 
40
?>