Generator PDF w PHP-Fusion
|
crasch |
Dodany dnia 04.04.2006 12:54:41
|

Zaawansowany

Postów: 1473
Data rejestracji: 02.01.2005 01:21
|
?wietny mod . Gratuluje.
pozdro
..i to by by?o na tyle.
28 listopada 2006
|
|
|
|
W?cibski Go?? |
Dodany dnia 06.09.2025 17:31:05
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
cakper |
Dodany dnia 04.04.2006 20:14:17
|

Bywalec

Postów: 334
Data rejestracji: 13.06.2005 15:59
|
wrzuci?em tego moda do skórki, która nie korzysta z theme_functions_include.php i ?miga 
ale mam pytanie, poniewa? mam w artykule fragmenty korzystaj?ce z czcionki courier i jak chc? dla niej wygenerowa? PDFa sie sypie
na jakiej zasadzie dodawa? nowe czcionki? |
|
|
|
Wooya |
Dodany dnia 04.04.2006 21:01:41
|

Zaawansowany

Postów: 1449 Pomógł: 22
Data rejestracji: 30.01.2005 15:40
|
Poszukaj w necie info o klasie FPDF. Uwaga! Czcionki arial w katalogu includes/output_pdf/font nie podmieniaj! Tak samo samych skryptow fpdf i html2pdf, gdyz sa one przerobione tak, aby obslugiwaly polskie znaki diaktryczne...
... Pomagam tylko przy najnowszych wersjach PHP-Fusion ...

|
|
|
|
cakper |
Dodany dnia 04.04.2006 21:06:52
|

Bywalec

Postów: 334
Data rejestracji: 13.06.2005 15:59
|
ok, to si? bior? za poszukiwania
na pocz?tku chcia?em go "oszuka?" i skopiowa?em te pliki i im tyko nazwy pozmienia?em, ale to nie przesz?o
Edytowane przez cakper dnia 04.04.2006 21:10:37
|
|
|
|
Shiro |
Dodany dnia 04.04.2006 21:07:39
|

Pocz?tkuj?cy

Postów: 175
Data rejestracji: 16.09.2005 20:30
|
Czy mog? to jako? zastosowa? w Themie. Ale tylko do artyku?ów podej?ewam ?e b?dzie treba zmodyfikowa? render_article tak wi?c zamieszczam t? c z??? thema
function render_article($subject, $article, $info) {
global $locale;
echo "<div id='block'>
<table align='center' border='0' cellpadding='0' cellspacing='0' width=97%>
<tr>
<td colspan='3'>
<table align='center' border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td valign='top' width='20'><img src='".THEME."images/mainblock_headerlft.gif' width='20' height='24' alt='' border='0'></td>
<td class='mainblock_header'><div class='mainblock_title'>$subject</div></td>
<td valign='top' align='right' width='121' class='mainblock_header'><img src='".THEME."images/mainblock_headerrt.gif' width='121' height='24' alt='' border='0'></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign='top' width='20'><img src='".THEME."images/block_toplft.gif' width='20' height='15' alt='' border='0'></td>
<td valign='top' background='".THEME."images/block_topbg.gif'><img src='".THEME."images/spacer.gif' width='1' height='15' alt='' border='0'></td>
<td valign='top' width='20'><img src='".THEME."images/block_toprt.gif' width='20' height='15' alt='' border='0'></td>
</tr>
<tr>
<td valign='top' width='20' background='".THEME."images/block_lftbg.gif'><img src='".THEME."images/spacer.gif' width='20' height='10' alt='' border='0'></td>
<td valign='top' class='block_content' width='100%'>".($info['article_breaks'] == "y" ? nl2br($article) : $article)."";
echo"<div class='rule'><img src='".THEME."images/spacer.gif' width='1' height='1' alt='' border='0'></div>
<div class='blockcontent_small'>";
echo "".$locale['040']."<a href='profile.php?lookup=".$info['user_id']."'>".$info['user_name']."</a> ";
echo "".$locale['041'].showdate("longdate", $info['article_date'])."<br />";
if ($info['article_allow_comments']) echo $info['article_comments'].$locale['043']." · ";
echo "".$info['article_reads'].$locale['044']." ";
echo "<a href='print.php?type=A&item_id=".$info['article_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' border='0' style='vertical-align:middle;'></a>";
echo"</div></td>
<td valign='top' width='20' background='".THEME."images/block_rtbg.gif'><img src='".THEME."images/spacer.gif' width='20' height='10' alt='' border='0'></td>
</tr>
<tr>
<td valign='top' width='20'><img src='".THEME."images/block_btmlft.gif' width='20' height='26' alt='' border='0'></td>
<td valign='top' background='".THEME."images/block_btmbg.gif'><img src='".THEME."images/spacer.gif' width='1' height='26' alt='' border='0'></td>
<td valign='top' width='20'><img src='".THEME."images/block_btmrt.gif' width='20' height='26' alt='' border='0'></td>
</tr>
</table>
</div>";
}
Edytowane przez Shiro dnia 04.04.2006 21:07:53
http://www.storytellers.pl
|
|
|
|
cakper |
Dodany dnia 04.04.2006 21:15:36
|

Bywalec

Postów: 334
Data rejestracji: 13.06.2005 15:59
|
po
echo "<a href='print.php?type=A&item_id=".$info['article_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' border='0' style='vertical-align:middle;'></a>";
dodaj
echo "<a href='pdf.php?type=A&item_id=".$info['article_id']."'><img src='".THEME."images/pdf.png' title='PDF document' alt='PDF document' style='vertical-align:middle;border:0px;'></a>";
i wszystkie pliki uploadnij i ju? |
|
|
|
Shiro |
Dodany dnia 04.04.2006 21:22:58
|

Pocz?tkuj?cy

Postów: 175
Data rejestracji: 16.09.2005 20:30
|
Super dzia?a!!!
http://www.storytellers.pl
|
|
|
|
cakper |
Dodany dnia 04.04.2006 21:31:53
|

Bywalec

Postów: 334
Data rejestracji: 13.06.2005 15:59
|
znalaz?em polskie fonty do fpdf, ale jeszcze nie uda?o mi si? ich zaprz?gn?? do pracy
mo?e komu? uda si? szybciej to zrobi? ni? mi wi?c zamieszczam paczk? z nimi
Edit:
Paczka jest zbyt du?a wi?c zaraz j? wrzuc? na mój serwer.
W paczce s? nast?puj?ce czcionki: arial, arial italic, arial bold, arial bold italic, times, times italic, times bold, times bold italic, courier, courier italic, courier bold, courier bold italic, verdana, verdana italic, verdana bold, verdana bold italic.
Prosz?: http://cakper.inf...nts_pl.rar
Edytowane przez cakper dnia 04.04.2006 21:35:43
|
|
|
|
Wooya |
Dodany dnia 05.04.2006 09:05:02
|

Zaawansowany

Postów: 1449 Pomógł: 22
Data rejestracji: 30.01.2005 15:40
|
Podrzucam poprawiony plik pdf.php z katalogu glownego dla tego moda. Teraz lepiej powinien obslugiwac obrazki.
<?php
/**
* Created by Phil Taylor
* Support file to display PDF Text Only using class from - http://www.ros.co.nz/pdf/readme.pdf
* HTMLDoc is available from: http://www.easysw.com/htmldoc and needs installing on the server for better HTML to PDF conversion
* ported to PHP-Fusion by Wooya, http://mfusion.2loud.net.pl
**/
if (!isset($item_id) && !isNum($item_id)) die();
if (!isset($type) && ($type!="A" || $type!="N" || $type!="CP")) die();
require ("maincore.php");
require (INCLUDES."output_pdf/html2fpdf.php");
switch ($type) {
case "A":
$result = dbquery("SELECT * FROM ".DB_PREFIX."articles WHERE article_id='".$item_id."'");
$data = dbarray($result);
$subject = stripslashes($data['article_subject']);
$snippet = stripslashes($data['article_snippet']);
$date = stripslashes($data['article_datetsamp']);
$req = substr(FUSION_REQUEST, 0, strrpos(FUSION_REQUEST, '/'));
$text = stripslashes(str_replace($req.'/images', $settings['siteurl'].'images', $data['article_article']));
$result = dbquery("SELECT user_name FROM ".DB_PREFIX."users WHERE user_id='".$data['article_name']."'");
$data = dbarray($result);
$footer = stripslashes($data['user_name']);
break;
case "N":
$result = dbquery("SELECT * FROM ".DB_PREFIX."news WHERE news_id='".$item_id."'");
$data = dbarray($result);
$subject = stripslashes($data['news_subject']);
$date = stripslashes($data['news_datestamp']);
$req = substr(FUSION_REQUEST, 0, strrpos(FUSION_REQUEST, '/'));
$snippet = stripslashes(str_replace($req.'/images', $settings['siteurl'].'images', $data['news_news']));
$text = stripslashes(str_replace($req.'/images', $settings['siteurl'].'images', $data['news_extended']));
$result = dbquery("SELECT user_name FROM ".DB_PREFIX."users WHERE user_id='".$data['news_name']."'");
$data = dbarray($result);
$footer = stripslashes($data['user_name']);
break;
case "CP":
$result = dbquery("SELECT * FROM ".DB_PREFIX."custom_pages WHERE page_id='".$item_id."'");
$data = dbarray($result);
$subject = stripslashes($data['page_title']);
$snippet = '';
$req = substr(FUSION_REQUEST, 0, strrpos(FUSION_REQUEST, '/'));
$text = str_replace($req.'/images', $settings['siteurl'].'images', $data['page_content']);
$text = stripslashes($text);
$text = eval('?>'.$text.'<?php ');
$footer = '';
break;
}
$pdf = new HTML2FPDF();
$pdf->Open();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Arial','B',14);
$pdf->WriteHTML('<br>'.$subject.'<br><br>');
if ($type!="CP" && $snippet!='') {
$pdf->SetFont('Arial','',11);
$pdf->WriteHTML($snippet);
if ($text!='') {
$pdf->WriteHTML('<br><br>');
}
}
if ($text!='') {
$pdf->SetFont('Arial','',11);
$pdf->WriteHTML($text);
}
if ($type!="CP") {
$pdf->SetFont('Arial','',8);
$pdf->WriteHTML("<br><br><hr><div align='right'>".$locale['040'].": ".$footer.", ".$locale['041']." ".showdate("longdate", $date)."</div>");
$pdf->SetAuthor($footer);
}
$pdf->Output();
?>
... Pomagam tylko przy najnowszych wersjach PHP-Fusion ...

|
|
|
|
cakper |
Dodany dnia 05.04.2006 09:16:33
|

Bywalec

Postów: 334
Data rejestracji: 13.06.2005 15:59
|
ok, dzi?ki Wooya
zamieszczam w za??czniku poprawny plik z czcionk? courier 
wystarczy wrzuci? do katalogu font i ju?
Wooya, czemu gdy generuj? jaki? artyku? to wychodzi mi on ciurkiem bez przechodzenia do nowych linii? troch? to tak niefajnie
przyk?ad: artyku? i jego PDF
cakper dodał/a następującą plik:
Edytowane przez cakper dnia 05.04.2006 09:20:54
|
|
|
|
Wooya |
Dodany dnia 05.04.2006 09:28:29
|

Zaawansowany

Postów: 1449 Pomógł: 22
Data rejestracji: 30.01.2005 15:40
|
hmmm... automatyczne lamanie linii jest wlaczone? uzywales standardowego edytora czy tinymce?
... Pomagam tylko przy najnowszych wersjach PHP-Fusion ...

|
|
|
|
cakper |
Dodany dnia 05.04.2006 09:29:24
|

Bywalec

Postów: 334
Data rejestracji: 13.06.2005 15:59
|
wszystko r?cznie z palca pisz?, ?adnych "u?atwiaczy ?ycia" nie u?ywam |
|
|
|
Wooya |
Dodany dnia 05.04.2006 09:36:33
|

Zaawansowany

Postów: 1449 Pomógł: 22
Data rejestracji: 30.01.2005 15:40
|
Juz mam rozwiazanie :) Zapomnialem sprawdzic czy ustawione sa "lamacze" linii :P
Oto poprawiony plik pdf.php:
<?php
/**
* Created by Phil Taylor
* Support file to display PDF Text Only using class from - http://www.ros.co.nz/pdf/readme.pdf
* HTMLDoc is available from: http://www.easysw.com/htmldoc and needs installing on the server for better HTML to PDF conversion
**/
if (!isset($item_id) && !isNum($item_id)) die();
if (!isset($type) && ($type!="A" || $type!="N" || $type!="CP")) die();
require ("maincore.php");
require (INCLUDES."output_pdf/html2fpdf.php");
switch ($type) {
case "A":
$result = dbquery("SELECT * FROM ".DB_PREFIX."articles WHERE article_id='".$item_id."'");
$data = dbarray($result);
$subject = stripslashes($data['article_subject']);
$snippet = stripslashes($data['article_snippet']);
if ($data['article_breaks']=="y") {
$snippet = nl2br($snippet);
}
$date = stripslashes($data['article_datetsamp']);
$req = substr(FUSION_REQUEST, 0, strrpos(FUSION_REQUEST, '/'));
$text = stripslashes(str_replace($req.'/images', $settings['siteurl'].'images', $data['article_article']));
if ($data['article_breaks']=="y") {
$text = nl2br($text);
}
$result = dbquery("SELECT user_name FROM ".DB_PREFIX."users WHERE user_id='".$data['article_name']."'");
$data = dbarray($result);
$footer = stripslashes($data['user_name']);
break;
case "N":
$result = dbquery("SELECT * FROM ".DB_PREFIX."news WHERE news_id='".$item_id."'");
$data = dbarray($result);
$subject = stripslashes($data['news_subject']);
$date = stripslashes($data['news_datestamp']);
$req = substr(FUSION_REQUEST, 0, strrpos(FUSION_REQUEST, '/'));
$snippet = stripslashes(str_replace($req.'/images', $settings['siteurl'].'images', $data['news_news']));
if ($data['news_breaks']=="y") {
$snippet = nl2br($snippet);
}
$text = stripslashes(str_replace($req.'/images', $settings['siteurl'].'images', $data['news_extended']));
if ($data['news_breaks']=="y") {
$text = nl2br($text);
}
$result = dbquery("SELECT user_name FROM ".DB_PREFIX."users WHERE user_id='".$data['news_name']."'");
$data = dbarray($result);
$footer = stripslashes($data['user_name']);
break;
case "CP":
$result = dbquery("SELECT * FROM ".DB_PREFIX."custom_pages WHERE page_id='".$item_id."'");
$data = dbarray($result);
$subject = stripslashes($data['page_title']);
$snippet = '';
$req = substr(FUSION_REQUEST, 0, strrpos(FUSION_REQUEST, '/'));
$text = str_replace($req.'/images', $settings['siteurl'].'images', $data['page_content']);
$text = stripslashes($text);
$text = eval('?>'.$text.'<?php ');
$footer = '';
break;
}
$pdf = new HTML2FPDF();
$pdf->Open();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Arial','B',14);
$pdf->WriteHTML('<br>'.$subject.'<br><br>');
if ($type!="CP" && $snippet!='') {
$pdf->SetFont('Arial','',11);
$pdf->WriteHTML($snippet);
if ($text!='') {
$pdf->WriteHTML('<br><br>');
}
}
if ($text!='') {
$pdf->SetFont('Arial','',11);
$pdf->WriteHTML($text);
}
if ($type!="CP") {
$pdf->SetFont('Arial','',8);
$pdf->WriteHTML("<br><br><hr><div align='right'>".$locale['040'].": ".$footer.", ".$locale['041']." ".showdate("longdate", $date)."</div>");
$pdf->SetAuthor($footer);
}
$pdf->Output();
?>
... Pomagam tylko przy najnowszych wersjach PHP-Fusion ...

|
|
|
|
cakper |
Dodany dnia 05.04.2006 09:40:00
|

Bywalec

Postów: 334
Data rejestracji: 13.06.2005 15:59
|
dobra, dzia?a super 
ale jeszcze jednego "buga" znalaz?em
patrz jak? dat? daje mi w pliku doc.pdf
Dodane przez : cakper, dnia 01 stycze? 1970 01:00
data dodania jest z marca czy co?, ale to nie jest wa?ne
w newsach data jest wy?wietlana dobrze
dzi?ki za moda!
Edytowane przez cakper dnia 05.04.2006 09:46:22
|
|
|
|
Wooya |
Dodany dnia 05.04.2006 10:13:50
|

Zaawansowany

Postów: 1449 Pomógł: 22
Data rejestracji: 30.01.2005 15:40
|
Sorki :P Oto poprawiony plik:
<?php
/**
* Created by Phil Taylor
* Support file to display PDF Text Only using class from - http://www.ros.co.nz/pdf/readme.pdf
* HTMLDoc is available from: http://www.easysw.com/htmldoc and needs installing on the server for better HTML to PDF conversion
**/
if (!isset($item_id) && !isNum($item_id)) die();
if (!isset($type) && ($type!="A" || $type!="N" || $type!="CP")) die();
require ("maincore.php");
require (INCLUDES."output_pdf/html2fpdf.php");
switch ($type) {
case "A":
$result = dbquery("SELECT * FROM ".DB_PREFIX."articles WHERE article_id='".$item_id."'");
$data = dbarray($result);
$subject = stripslashes($data['article_subject']);
$snippet = stripslashes($data['article_snippet']);
if ($data['article_breaks']=="y") {
$snippet = nl2br($snippet);
}
$date = stripslashes($data['article_datestamp']);
$req = substr(FUSION_REQUEST, 0, strrpos(FUSION_REQUEST, '/'));
$text = stripslashes(str_replace($req.'/images', $settings['siteurl'].'images', $data['article_article']));
if ($data['article_breaks']=="y") {
$text = nl2br($text);
}
$result = dbquery("SELECT user_name FROM ".DB_PREFIX."users WHERE user_id='".$data['article_name']."'");
$data = dbarray($result);
$footer = stripslashes($data['user_name']);
break;
case "N":
$result = dbquery("SELECT * FROM ".DB_PREFIX."news WHERE news_id='".$item_id."'");
$data = dbarray($result);
$subject = stripslashes($data['news_subject']);
$date = stripslashes($data['news_datestamp']);
$req = substr(FUSION_REQUEST, 0, strrpos(FUSION_REQUEST, '/'));
$snippet = stripslashes(str_replace($req.'/images', $settings['siteurl'].'images', $data['news_news']));
if ($data['news_breaks']=="y") {
$snippet = nl2br($snippet);
}
$text = stripslashes(str_replace($req.'/images', $settings['siteurl'].'images', $data['news_extended']));
if ($data['news_breaks']=="y") {
$text = nl2br($text);
}
$result = dbquery("SELECT user_name FROM ".DB_PREFIX."users WHERE user_id='".$data['news_name']."'");
$data = dbarray($result);
$footer = stripslashes($data['user_name']);
break;
case "CP":
$result = dbquery("SELECT * FROM ".DB_PREFIX."custom_pages WHERE page_id='".$item_id."'");
$data = dbarray($result);
$subject = stripslashes($data['page_title']);
$snippet = '';
$req = substr(FUSION_REQUEST, 0, strrpos(FUSION_REQUEST, '/'));
$text = str_replace($req.'/images', $settings['siteurl'].'images', $data['page_content']);
$text = stripslashes($text);
$text = eval('?>'.$text.'<?php ');
$footer = '';
break;
}
$pdf = new HTML2FPDF();
$pdf->Open();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Arial','B',14);
$pdf->WriteHTML('<br>'.$subject.'<br><br>');
if ($type!="CP" && $snippet!='') {
$pdf->SetFont('Arial','',11);
$pdf->WriteHTML($snippet);
if ($text!='') {
$pdf->WriteHTML('<br><br>');
}
}
if ($text!='') {
$pdf->SetFont('Arial','',11);
$pdf->WriteHTML($text);
}
if ($type!="CP") {
$pdf->SetFont('Arial','',8);
$pdf->WriteHTML("<br><br><hr><div align='right'>".$locale['040'].": ".$footer.", ".$locale['041']." ".showdate("longdate", $date)."</div>");
$pdf->SetAuthor($footer);
}
$pdf->Output();
?>
... Pomagam tylko przy najnowszych wersjach PHP-Fusion ...

|
|
|
|
cakper |
Dodany dnia 05.04.2006 12:06:05
|

Bywalec

Postów: 334
Data rejestracji: 13.06.2005 15:59
|
OK, dzi?ki
dzia?a super |
|
|
|
Wooya |
Dodany dnia 05.04.2006 21:28:20
|

Zaawansowany

Postów: 1449 Pomógł: 22
Data rejestracji: 30.01.2005 15:40
|
@cakper: Jakbys jeszcze na swej stronce podal zrodlo moda PDF (czytaj: mnie ), to by bylo super Niby niewiele, ale reklama dzwignia handlu
... Pomagam tylko przy najnowszych wersjach PHP-Fusion ...

|
|
|
|
Pieka |
Dodany dnia 05.04.2006 22:47:41
|


Postów: 19887 Pomógł: 767
v7.02.03 Data rejestracji: 23.02.2005 18:12
|
cakper napisa?/a:
ok, dzi?ki Wooya
zamieszczam w za??czniku poprawny plik z czcionk? courier 
wystarczy wrzuci? do katalogu font i ju?
Wooya, czemu gdy generuj? jaki? artyku? to wychodzi mi on ciurkiem bez przechodzenia do nowych linii? troch? to tak niefajnie
przyk?ad: artyku? i jego PDF
Dziekuje za plik!!
Przed chwila bardzo mi sie przydal
Jestem jaki jestem 
|
|
|
|
cakper |
Dodany dnia 06.04.2006 07:58:02
|

Bywalec

Postów: 334
Data rejestracji: 13.06.2005 15:59
|
Wooya, si? robi 
Mo?e by? tak jak jest teraz?
Edytowane przez cakper dnia 06.04.2006 08:01:45
|
|
|
|
Wooya |
Dodany dnia 06.04.2006 08:07:44
|

Zaawansowany

Postów: 1449 Pomógł: 22
Data rejestracji: 30.01.2005 15:40
|
Podoba sie mnie
... Pomagam tylko przy najnowszych wersjach PHP-Fusion ...

|
|
|