content2pdf it's born! :D

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

content2pdf it's born! :D

Post by megabob3 »

It's baby, first faster version.

http://dev.cmsmadesimple.org/projects/content2pdf/

I must dedicate time for rendering my codes more user-friendly :P

Sorry to all.


Enjoy this new integration :D


PS:
  see in action here:
  http://www.awakening.it/cmsms_dl/
Last edited by megabob3 on Mon Dec 05, 2005 5:16 pm, edited 1 time in total.
MichaelK

Re: content2pdf it's born! :D

Post by MichaelK »

How can i insert this?

{pdf} ?
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

Re: content2pdf it's born! :D

Post by megabob3 »

MichaelK wrote: How can i insert this?

{pdf} ?
{cms_module module='Content2Pdf'}
Piratos

Re: content2pdf it's born! :D

Post by Piratos »

I have made a link to create.php and it works (but the link settings of the fckeditor doesn't work - i must made the link in the sourcecode).

So it looks great - the go back link has no function or  works it with the module - link ?





[attachment deleted by admin]
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

Re: content2pdf it's born! :D

Post by megabob3 »

Piratos wrote: I have made a link to create.php and it works (but the link settings of the fckeditor doesn't work - i must made the link in the sourcecode).

So it looks great - the go back link has no function or  works it with the module - link ?

Why made a link directly to "create" and not insert  {cms_module module='Content2Pdf'}

I have to ASK to Wishy a feature request.
I prefer that "the go back link" not be showed, adding a new parameter when that say to CMSMS the print mode.

Bye ;)
Last edited by megabob3 on Mon Dec 05, 2005 7:45 pm, edited 1 time in total.
westis

Re: content2pdf it's born! :D

Post by westis »

Roman has made some changes to the {print} tag that will be included soon, probably 0.11.1. That gives an option to not display the Go Back button. See http://forum.cmsmadesimple.org/index.ph ... l#msg12406
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

Re: content2pdf it's born! :D

Post by megabob3 »

westis wrote: Roman has made some changes to the {print} tag that will be included soon, probably 0.11.1. That gives an option to not display the Go Back button. See http://forum.cmsmadesimple.org/index.ph ... l#msg12406
Very nice to listen :D, i will wait this modification :D

Please WiseQ remember to do for me also an image that combine CMSMS with PDF.

This image must replace the string PDF.

Bye ;)
Piratos

Re: content2pdf it's born! :D

Post by Piratos »

Why made a link directly to "create" and not insert  {cms_module module='Content2Pdf'}
No help no readme, but i can read scripts.
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

Re: content2pdf it's born! :D

Post by megabob3 »

Piratos wrote:
Why made a link directly to "create" and not insert  {cms_module module='Content2Pdf'}
No help no readme, but i can read scripts.
Lol :P
Piratos

Re: content2pdf it's born! :D

Post by Piratos »

I have changed the code from create.php to this:

Code: Select all

<?php
require_once(dirname(dirname(dirname(__FILE__)))."/config.php");
require_once(dirname(__FILE__).'/html2fpdf/html2fpdf.php');
// activate Output-Buffer:
ob_start();
include($config['root_url']."/index.php?page=".$_GET["page_id"]."&print=false");
// Output-Buffer in variable:
$html=ob_get_contents();
// delete Output-Buffer
ob_end_clean();
$pdf = new HTML2FPDF();
$pdf->setBasePath("../../..");
$pdf->DisplayPreferences('HideWindowUI');
$pdf->AddPage();
$pdf->WriteHTML($html);
$pdf->Output($_GET["page_name"].'.pdf','I');
unset($pdf);
?>
Two parts in content.functions.php must change to this:

Code: Select all

$t=$_GET["print"];
				        if ($t == "true")
				        {$tpl_source = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'."\n".'<__html><head><title>{title}</title><meta name="robots" content="noindex"></meta>{stylesheet}{literal}<style type="text/css" media="print">#back {display: none;}</style>{/literal}</head></__body style="background-color: white; color: black; background-image: none;"><form action="index.php?page='.$tpl_name.'" method="post"><input type="submit" value="Go Back"></form>{content}<__body></__html>';}
				        else
				        {$tpl_source = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'."\n".'<__html><head><title>{title}</title><meta name="robots" content="noindex"></meta>{stylesheet}{literal}<style type="text/css" media="print">#back {display: none;}</style>{/literal}</head></__body style="background-color: white; color: black; background-image: none;">{content}<__body></__html>';}
and Go Back is gone.

it is compatible with all others because the cms ask only isset not the value.
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

Re: content2pdf it's born! :D

Post by megabob3 »

Thx :)

i prefer this :P

Code: Select all

<?php

$dir = dirname(__FILE__);
$inclfilename = $dir.'/config.php';

while(!@file_exists($inclfilename) && (strcmp($dir, dirname($dir)) != 0) ){
            $dir = dirname($dir);
            $inclfilename = $dir.'/config.php';
}
@require_once($inclfilename);

require(dirname(__FILE__).'/html2fpdf/html2fpdf.php');
// activate Output-Buffer:
ob_start();

include($config['root_url']."/index.php?page=".$_GET["page_id"]."&print=true");

// Output-Buffer in variable:
$html=ob_get_contents();
// delete Output-Buffer
ob_end_clean();
$pdf = new HTML2FPDF();

$pdf->setBasePath("../../..");
$pdf->DisplayPreferences('HideWindowUI');
$pdf->AddPage();
$pdf->WriteHTML($html);
$pdf->Output($_GET["page_name"].'.pdf','I');
unset($pdf);
?>
About BACK link, are modifying CMSMS core adding the parameter ;)
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

Re: content2pdf it's born! :D

Post by megabob3 »

I next version i will ADD necessary parameter like LANDSCAPE or PORTRAIT and ....
Piratos

Re: content2pdf it's born! :D

Post by Piratos »

i played with the used libs  a long time before you create this small module.

the only problem is always to get more fonts. if you have enough you can print out the whole page.

fonts are often with a copyright and cannot be used in opensource.

that is the risk.
Azrae

Re: content2pdf it's born! :D

Post by Azrae »

hm, is there a possibility to use this mode without url-file-access?

Technically I should, if I'am not completly wrong.
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm
Location: ITALY

Re: content2pdf it's born! :D

Post by megabob3 »

Azrael wrote: hm, is there a possibility to use this mode without url-file-access?

Technically I should, if I'am not completly wrong.
Please explain better what you wish do.

Bye ;)
Post Reply

Return to “Modules/Add-Ons”