Create PDF: Using command line switches

7 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 28, 2013   (RSS)

By Toledoh - May 26, 2013 - edited: May 26, 2013

Hi Guys,

I'm trying to use the command line switches with create PDF, but it doesn't seem to be working.

The plugin itself is working fine, but even the example: admin.php?_pluginName=createPDF&_pluginAction=examples&filename=advanced_using_command_line_switches.php doesn't seem to work.

Is there a bug?

I'm trying to remove the margins, and make sure the page is set to A4...

Cheers,

Tim (toledoh.com.au)

By Daryl - May 27, 2013

Hi Tim,

We tested the create PDF switches command line and it isn't a bug.

I tried this code with multiple options and it works:

$GLOBALS['CREATEPDF_CUSTOM_SWITCHES'] = '--orientation landscape --margin-top 0 --margin-left 0 --margin-right 0 --margin-bottom 0';

Would you mind if I take a look at your code for switches command line by pasting it here?

Thanks,

Daryl

Daryl Maximo
PHP Programmer - interactivetools.com

By Toledoh - May 27, 2013

Thanks Daryl,

Strange, but I changed from using a proxy server, and it now works.

Thanks!

Cheers,

Tim (toledoh.com.au)

By Toledoh - May 27, 2013

Actually - it doesn't... it's better, but I can't get rid of all margins;

<?php
    $GLOBALS['CREATEPDF_CUSTOM_SWITCHES'] = '--orientation portrait --margin-top 0 --margin-left 0 --margin-right 0 --margin-bottom 0';
    createPDF_fromOutput('inline', 'example.pdf');
?>

File attached, and can be viewed here: http://111.118.173.162/~pmafresh/v3/delegateLables.php

Cheers,

Tim (toledoh.com.au)
Attachments:

delegatelables.php 3K

By Daryl - May 27, 2013 - edited: May 27, 2013

Hi Tim,

I think the problem is in your CSS formating. Try to make the body's margin to 0 : body { margin: 0;}

Also on your attached file "delegatelables.php", you missed the "--margin-top 0" .

Check out the attached file.

Hope this helps!

Thanks,

Daryl

Daryl Maximo
PHP Programmer - interactivetools.com

By Toledoh - May 27, 2013

Nope - didn't work... but I'm a bit rushed at the moment and may make a silly mistake.  I'll get back to you.  Thanks for your help!

Cheers,

Tim (toledoh.com.au)