Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #8882 > unrolled thread
| Started by | badmus aliu <bajab247@gmail.com> |
|---|---|
| First post | 2013-03-28 01:40 -0700 |
| Last post | 2013-03-29 12:16 +0000 |
| Articles | 20 on this page of 28 — 8 participants |
Back to article view | Back to comp.lang.php
PHP: convert a page to pdf badmus aliu <bajab247@gmail.com> - 2013-03-28 01:40 -0700
Re: PHP: convert a page to pdf The Natural Philosopher <tnp@invalid.invalid> - 2013-03-28 10:57 +0000
Re: PHP: convert a page to pdf The Natural Philosopher <tnp@invalid.invalid> - 2013-03-28 11:15 +0000
Re: PHP: convert a page to pdf Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-28 09:14 -0400
Re: PHP: convert a page to pdf Michael Vilain <vilain@NOspamcop.net> - 2013-03-28 09:50 -0700
Re: PHP: convert a page to pdf The Natural Philosopher <tnp@invalid.invalid> - 2013-03-28 17:31 +0000
Re: PHP: convert a page to pdf adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) - 2013-03-28 17:32 +0000
Re: PHP: convert a page to pdf The Natural Philosopher <tnp@invalid.invalid> - 2013-03-28 18:04 +0000
Re: PHP: convert a page to pdf adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) - 2013-03-28 19:14 +0000
Re: PHP: convert a page to pdf The Natural Philosopher <tnp@invalid.invalid> - 2013-03-28 19:42 +0000
Re: PHP: convert a page to pdf [OT] adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) - 2013-03-28 21:38 +0000
Re: PHP: convert a page to pdf [OT] The Natural Philosopher <tnp@invalid.invalid> - 2013-03-28 22:30 +0000
Re: PHP: convert a page to pdf [OT] adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) - 2013-03-29 08:44 +0000
Re: PHP: convert a page to pdf [OT] The Natural Philosopher <tnp@invalid.invalid> - 2013-03-29 12:59 +0000
Re: PHP: convert a page to pdf [OT] Tim Streater <timstreater@greenbee.net> - 2013-03-29 13:18 +0000
[OT] Pre-emptive multi-tasking (was: PHP: convert a page to pdf [OT]) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-29 15:01 +0100
Re: [OT] Pre-emptive multi-tasking (was: PHP: convert a page to pdf [OT]) Tim Streater <timstreater@greenbee.net> - 2013-03-29 16:57 +0000
Re: [OT] Pre-emptive multi-tasking The Natural Philosopher <tnp@invalid.invalid> - 2013-03-29 17:13 +0000
Re: [OT] Pre-emptive multi-tasking Tim Streater <timstreater@greenbee.net> - 2013-03-29 17:20 +0000
Re: PHP: convert a page to pdf [OT] The Natural Philosopher <tnp@invalid.invalid> - 2013-03-29 14:41 +0000
Re: PHP: convert a page to pdf [OT] Tim Streater <timstreater@greenbee.net> - 2013-03-29 16:36 +0000
Re: PHP: convert a page to pdf [OT] adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) - 2013-03-29 13:57 +0000
Re: PHP: convert a page to pdf [OT] Michael Vilain <vilain@NOspamcop.net> - 2013-03-29 11:22 -0700
Re: PHP: convert a page to pdf Tim Streater <timstreater@greenbee.net> - 2013-03-28 21:19 +0000
Re: PHP: convert a page to pdf Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-28 18:39 +0100
Re: PHP: convert a page to pdf The Natural Philosopher <tnp@invalid.invalid> - 2013-03-28 18:06 +0000
Re: PHP: convert a page to pdf Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-28 15:21 -0400
Re: PHP: convert a page to pdf Andy <str_343@hotmail.com> - 2013-03-29 12:16 +0000
Page 1 of 2 [1] 2 Next page →
| From | badmus aliu <bajab247@gmail.com> |
|---|---|
| Date | 2013-03-28 01:40 -0700 |
| Subject | PHP: convert a page to pdf |
| Message-ID | <a2b28350-6f57-43bc-935e-66a179409287@googlegroups.com> |
can anyone help me on how to convert a database driven page to pdf using php
[toc] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-03-28 10:57 +0000 |
| Message-ID | <kj17mm$ndn$1@news.albasani.net> |
| In reply to | #8882 |
On 28/03/13 08:40, badmus aliu wrote:
> can anyone help me on how to convert a database driven page to pdf using php
>
google PDFliblite - its a free version of a commercial library that
gives you the tools to make a reasonable PDF page.
http://www.pdflib.com/download/free-software/pdflib-lite-7/
http://pecl.php.net/package/pdflib
Its not to be used for profit - then you should buy the commercial version.
You may need to install a few fonts on your web server as well as the
library and the PHP library shims if you want to use fonts other than
the basic postcript ones. All of this is a bit clunky, but once there it
works.
here is a library in PDF I created to print, download or email invoices
as PDF attachments. Using the PDFliblite functions as primitives.
<?php
// Here we go then. Simple functions to set up text an images into PDF
format.
// Probably worth having some global variables../
$font=0; //current font handle
$fontstyle="normal";
$fontpoint=10;
$pdf=""; // the current resource.
function setfont($size,$weight)
{
global $fontpoint;
$fontpoint=$size;
global $fontstyle;
global $font;
global $pdf;
if ($fontstyle!=$weight)
{
if ($weight=='normal')
$font=pdf_load_font($pdf,"Helvetica","iso8859-1","");
else if ($weight=='bold')
$font=pdf_load_font($pdf,"Helvetica-Bold","iso8859-1","");
else if ($weight=='italic')
$font=pdf_load_font($pdf,"Helvetica-Oblique","iso8859-1","");
else if ($weight=='bold-italic')
$font=pdf_load_font($pdf,"Helvetica-BoldOblique","iso8859-1","");
$fontstyle=$weight;
}
pdf_setfont($pdf,$font,$fontpoint);
}
function end_page()
{
global $pdf;
PDF_end_page($pdf);
}
function close_document()
{
global $pdf;
pdf_close($pdf);
}
function new_page($title)
{
global $font,$fontweight,$fontstyle,$fontpoint,$pdf;
pdf_begin_page($pdf,595,842);
box(15,750,565,50,"#D0D0D0",0);
setfont(14,'bold');
$img=pdf_load_image($pdf,"gif","../Images/Logo2.gif","" );
pdf_place_image($pdf,$img,25,777,0.10);
text(297.5,760,$title,'centre');
setfont(8,'normal');
date_default_timezone_set ("Europe/London");
text(470,790,date("G:i T: D M d Y"),'left');
}
function new_document()
{
global $pdf;
$pdf=PDF_new();
pdf_begin_document($pdf,"","compatibility=1.5");
}
function text($x,$y,$text,$align)
{
global $pdf,$font,$fontpoint;
pdf_setfont($pdf,$font,$fontpoint);
// $text=mb_convert_encoding($text, "ISO-8859-1","UTF-8");
if($align=='right')
$x-=pdf_stringwidth($pdf,$text,$font,$fontpoint);
else if ($align=='centre')
$x-=pdf_stringwidth($pdf,$text,$font,$fontpoint)/2;
pdf_show_xy($pdf,$text,$x,$y);
return pdf_stringwidth($pdf,$text,$font,$fontpoint);
}
function box($x,$y,$width,$height,$color) // color is #XXXXXX
{
global $pdf;
setcolor($color);
pdf_rect($pdf,$x,$y,$width,$height);
pdf_fill($pdf);
setcolor("#000000"); // back to black.
}
function setcolor($color)
{
global $pdf;
$string = str_replace("#","",$color);
$red = hexdec(substr($string,0,2)) / 255;
$green = hexdec(substr($string,2,2)) / 255;
$blue = hexdec(substr($string,4,2)) / 255;
pdf_setcolor($pdf,"fill",'rgb', $red, $green, $blue,0);
}
function send_pdf_file($name)
{
global $pdf;
$buf = PDF_get_buffer($pdf);
$len = strlen($buf);
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=\"".$name.".pdf\"");
print $buf;
}
function print_pdf_file($printer)
{
global $pdf;
$buf = PDF_get_buffer($pdf);
$len=strlen($buf);
$handle=popen("/usr/bin/lp -o sides=one-sided -d ".$printer." -- -", 'w');
fwrite($handle,$buf);
}
function mail_pdf_file($email, $subject,$from,$return_path,$body,$filename)
{
global $pdf;
$buf=PDF_get_buffer($pdf);
$attach=chunk_split( base64_encode($buf),72, "\n");
$boundary = md5( time() );
$headers = sprintf("From: %s\nMIME-Version: 1.0\nContent-Type:
multipart/mixed; boundary=\"%s\"",
$from, $boundary);
$message = sprintf("\nThis is a multi-part message in MIME
format.\n--%s\nContent-Type: text/plain; charset=UTF-8;
format=flowed\nContent-Transfer-Encoding:
7bit\n\n%s\n\n--%s\nContent-Type: application/pdf;
name=\"%s\"\nContent-Disposition: inline;
filename=\"%s\"\nContent-Transfer-Encoding: base64\n\n%s\n\n--%s--\n",
$boundary,$body,$boundary,$filename, $filename,$attach,$boundary);
mail($email, $subject, $message, $headers, "-f ".$return_path );
}
?>
--
Ineptocracy
(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-03-28 11:15 +0000 |
| Message-ID | <kj18oa$pne$1@news.albasani.net> |
| In reply to | #8883 |
On 28/03/13 10:57, The Natural Philosopher wrote:
> On 28/03/13 08:40, badmus aliu wrote:
>> can anyone help me on how to convert a database driven page to pdf
>> using php
>>
> google PDFliblite - its a free version of a commercial library that
> gives you the tools to make a reasonable PDF page.
>
>
> http://www.pdflib.com/download/free-software/pdflib-lite-7/
> http://pecl.php.net/package/pdflib
>
>
> Its not to be used for profit - then you should buy the commercial version.
>
> You may need to install a few fonts on your web server as well as the
> library and the PHP library shims if you want to use fonts other than
> the basic postcript ones. All of this is a bit clunky, but once there it
> works.
>
> here is a library in PDF I created to print, download or email invoices
> as PDF attachments. Using the PDFliblite functions as primitives.
>
> <?php
> // Here we go then. Simple functions to set up text an images into PDF
> format.
> // Probably worth having some global variables../
>
> $font=0; //current font handle
> $fontstyle="normal";
> $fontpoint=10;
> $pdf=""; // the current resource.
>
> function setfont($size,$weight)
> {
> global $fontpoint;
> $fontpoint=$size;
> global $fontstyle;
> global $font;
> global $pdf;
> if ($fontstyle!=$weight)
> {
> if ($weight=='normal')
> $font=pdf_load_font($pdf,"Helvetica","iso8859-1","");
> else if ($weight=='bold')
> $font=pdf_load_font($pdf,"Helvetica-Bold","iso8859-1","");
> else if ($weight=='italic')
> $font=pdf_load_font($pdf,"Helvetica-Oblique","iso8859-1","");
> else if ($weight=='bold-italic')
>
> $font=pdf_load_font($pdf,"Helvetica-BoldOblique","iso8859-1","");
> $fontstyle=$weight;
> }
> pdf_setfont($pdf,$font,$fontpoint);
> }
>
> function end_page()
> {
> global $pdf;
> PDF_end_page($pdf);
> }
> function close_document()
> {
> global $pdf;
> pdf_close($pdf);
> }
> function new_page($title)
> {
> global $font,$fontweight,$fontstyle,$fontpoint,$pdf;
> pdf_begin_page($pdf,595,842);
> box(15,750,565,50,"#D0D0D0",0);
> setfont(14,'bold');
> $img=pdf_load_image($pdf,"gif","../Images/Logo2.gif","" );
> pdf_place_image($pdf,$img,25,777,0.10);
> text(297.5,760,$title,'centre');
> setfont(8,'normal');
> date_default_timezone_set ("Europe/London");
> text(470,790,date("G:i T: D M d Y"),'left');
> }
> function new_document()
> {
> global $pdf;
> $pdf=PDF_new();
> pdf_begin_document($pdf,"","compatibility=1.5");
> }
>
> function text($x,$y,$text,$align)
> {
> global $pdf,$font,$fontpoint;
> pdf_setfont($pdf,$font,$fontpoint);
> // $text=mb_convert_encoding($text, "ISO-8859-1","UTF-8");
> if($align=='right')
> $x-=pdf_stringwidth($pdf,$text,$font,$fontpoint);
> else if ($align=='centre')
> $x-=pdf_stringwidth($pdf,$text,$font,$fontpoint)/2;
> pdf_show_xy($pdf,$text,$x,$y);
> return pdf_stringwidth($pdf,$text,$font,$fontpoint);
> }
>
> function box($x,$y,$width,$height,$color) // color is #XXXXXX
> {
> global $pdf;
> setcolor($color);
> pdf_rect($pdf,$x,$y,$width,$height);
> pdf_fill($pdf);
> setcolor("#000000"); // back to black.
> }
> function setcolor($color)
> {
> global $pdf;
> $string = str_replace("#","",$color);
> $red = hexdec(substr($string,0,2)) / 255;
> $green = hexdec(substr($string,2,2)) / 255;
> $blue = hexdec(substr($string,4,2)) / 255;
> pdf_setcolor($pdf,"fill",'rgb', $red, $green, $blue,0);
> }
> function send_pdf_file($name)
> {
> global $pdf;
> $buf = PDF_get_buffer($pdf);
> $len = strlen($buf);
> header("Content-type: application/pdf");
> header("Content-Length: $len");
> header("Content-Disposition: inline; filename=\"".$name.".pdf\"");
> print $buf;
> }
> function print_pdf_file($printer)
> {
> global $pdf;
> $buf = PDF_get_buffer($pdf);
> $len=strlen($buf);
> $handle=popen("/usr/bin/lp -o sides=one-sided -d ".$printer." --
> -", 'w');
> fwrite($handle,$buf);
> }
>
> function mail_pdf_file($email, $subject,$from,$return_path,$body,$filename)
> {
> global $pdf;
> $buf=PDF_get_buffer($pdf);
> $attach=chunk_split( base64_encode($buf),72, "\n");
> $boundary = md5( time() );
> $headers = sprintf("From: %s\nMIME-Version: 1.0\nContent-Type:
> multipart/mixed; boundary=\"%s\"",
> $from, $boundary);
> $message = sprintf("\nThis is a multi-part message in MIME
> format.\n--%s\nContent-Type: text/plain; charset=UTF-8;
> format=flowed\nContent-Transfer-Encoding:
> 7bit\n\n%s\n\n--%s\nContent-Type: application/pdf;
> name=\"%s\"\nContent-Disposition: inline;
> filename=\"%s\"\nContent-Transfer-Encoding: base64\n\n%s\n\n--%s--\n",
> $boundary,$body,$boundary,$filename, $filename,$attach,$boundary);
> mail($email, $subject, $message, $headers, "-f ".$return_path );
> }
> ?>
>
>
>
PS: I forgot to mention that in order to do this you need unrestricted
access to the server including possibly a compiler and the ability to
install PEAR stuff and C libraries - i.e. root access on a *nix system -
to install this, which no commercial hosting company will do, unless
you pay them money, and not likely even then.
In my case the solution was to employ them in an intranet, and on a
virtual server, that I control. I accept this is not always the
preferred solution for many people.
I knew then, of no better way to achieve the desired endpoint.
Perhaps one exists now.
--
Ineptocracy
(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-03-28 09:14 -0400 |
| Message-ID | <kj1fjh$vse$1@dont-email.me> |
| In reply to | #8882 |
On 3/28/2013 4:40 AM, badmus aliu wrote: > can anyone help me on how to convert a database driven page to pdf using php > There are a number of packages which will allow you to create a PDF. Did you try googling for "php pdf" (without the quotes)? I happen to like fpdf (www.fpdf.org). But if you're looking for an easy way to do it, there isn't. The page is rendered by the browser, and PHP as no access to the rendered page. You'll need to generate the page as a pdf (you can start with your existing code). You won't be able to just "scrape" the browser. Another option would be one of the HTML to PDF generators - these can take the HTML you've already generated and create a PDF from that. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Michael Vilain <vilain@NOspamcop.net> |
|---|---|
| Date | 2013-03-28 09:50 -0700 |
| Message-ID | <vilain-82CAD9.09502028032013@news.individual.net> |
| In reply to | #8882 |
In article <a2b28350-6f57-43bc-935e-66a179409287@googlegroups.com>, badmus aliu <bajab247@gmail.com> wrote: > can anyone help me on how to convert a database driven page to pdf using php On MacOS, just print the generated page and save to PDF. On Windows or Linux, you'll have to code a solution using various libraries. -- DeeDee, don't press that button! DeeDee! NO! Dee... [I filter all Goggle Groups posts, so any reply may be automatically ignored]
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-03-28 17:31 +0000 |
| Message-ID | <kj1upj$8et$2@news.albasani.net> |
| In reply to | #8886 |
On 28/03/13 16:50, Michael Vilain wrote: > In article <a2b28350-6f57-43bc-935e-66a179409287@googlegroups.com>, > badmus aliu <bajab247@gmail.com> wrote: > >> can anyone help me on how to convert a database driven page to pdf using php > > On MacOS, just print the generated page and save to PDF. > thats hardly a server sode solution is it? > On Windows or Linux, you'll have to code a solution using various > libraries. > well no, you could print the page and save as pdf there as well. -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) |
|---|---|
| Date | 2013-03-28 17:32 +0000 |
| Message-ID | <1l0gdof.1hvdzkhvfl5caN%adrian@poppyrecords.invalid.invalid> |
| In reply to | #8886 |
Michael Vilain <vilain@NOspamcop.net> wrote: > In article <a2b28350-6f57-43bc-935e-66a179409287@googlegroups.com>, > badmus aliu <bajab247@gmail.com> wrote: > > > can anyone help me on how to convert a database driven page to pdf using php > > On MacOS, just print the generated page and save to PDF. I think this only works with OSX. In the earlier MacOSs (OS 6 to OS9), the print command will allow you to Save to file. This gives a PostScript document which you can then convert to PDF with Distiller. Some MacOS applications such as PageMaker 6.5 have an option to export as a PDF; but it isn't really a direct conversion, it still goes through the PostScript- Distiller route. -- ~ Adrian Tuddenham ~ (Remove the ".invalid"s and add ".co.uk" to reply) www.poppyrecords.co.uk
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-03-28 18:04 +0000 |
| Message-ID | <kj20n9$cib$1@news.albasani.net> |
| In reply to | #8888 |
On 28/03/13 17:32, Adrian Tuddenham wrote: > Michael Vilain <vilain@NOspamcop.net> wrote: > >> In article <a2b28350-6f57-43bc-935e-66a179409287@googlegroups.com>, >> badmus aliu <bajab247@gmail.com> wrote: >> >>> can anyone help me on how to convert a database driven page to pdf using php >> >> On MacOS, just print the generated page and save to PDF. > > I think this only works with OSX. In the earlier MacOSs (OS 6 to OS9), > the print command will allow you to Save to file. This gives a > PostScript document which you can then convert to PDF with Distiller. > works just fine here on linux. Print to file defaults to a pdf, on Firefox. > Some MacOS applications such as PageMaker 6.5 have an option to export > as a PDF; but it isn't really a direct conversion, it still goes through > the PostScript- Distiller route. > shows how backward OSX is.. > However that's not what the OP wants. he doesn't want to involve the users browser. he wants to generate a pdf an the server. Or why else would he ask in a PHP newsgroup? -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) |
|---|---|
| Date | 2013-03-28 19:14 +0000 |
| Message-ID | <1l0ghr4.e5kt5u1equ8b4N%adrian@poppyrecords.invalid.invalid> |
| In reply to | #8890 |
The Natural Philosopher <tnp@invalid.invalid> wrote: > On 28/03/13 17:32, Adrian Tuddenham wrote: > > Michael Vilain <vilain@NOspamcop.net> wrote: > > > >> In article <a2b28350-6f57-43bc-935e-66a179409287@googlegroups.com>, > >> badmus aliu <bajab247@gmail.com> wrote: > >> > >>> can anyone help me on how to convert a database driven page to pdf >>>using php > >> > >> On MacOS, just print the generated page and save to PDF. > > > > I think this only works with OSX. In the earlier MacOSs (OS 6 to OS9), > > the print command will allow you to Save to file. This gives a > > PostScript document which you can then convert to PDF with Distiller. > > > > works just fine here on linux. Print to file defaults to a pdf, on Firefox. I don't understand the relevance of this reply. Neither Linux nor Firefox can run under MacOS. > > > Some MacOS applications such as PageMaker 6.5 have an option to export > > as a PDF; but it isn't really a direct conversion, it still goes through > > the PostScript- Distiller route. > > > > shows how backward OSX is.. Again, I cannot see a connection betwen your reply and the preceding comment, because PageMaker 6.5 is not an OSX application. > > > > However that's not what the OP wants. he doesn't want to involve the > users browser. > > he wants to generate a pdf an the server. Or why else would he ask in a > PHP newsgroup? I fully appreciate that; but I felt it was necessary to correct any possible confusion between the behaviour of Mac OS and of OSX, which could have misled others who read this group. -- ~ Adrian Tuddenham ~ (Remove the ".invalid"s and add ".co.uk" to reply) www.poppyrecords.co.uk
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-03-28 19:42 +0000 |
| Message-ID | <kj26f4$oes$1@news.albasani.net> |
| In reply to | #8892 |
On 28/03/13 19:14, Adrian Tuddenham wrote: > The Natural Philosopher <tnp@invalid.invalid> wrote: > >> On 28/03/13 17:32, Adrian Tuddenham wrote: >>> Michael Vilain <vilain@NOspamcop.net> wrote: >>> >>>> In article <a2b28350-6f57-43bc-935e-66a179409287@googlegroups.com>, >>>> badmus aliu <bajab247@gmail.com> wrote: >>>> >>>>> can anyone help me on how to convert a database driven page to pdf >>>> using php >>>> >>>> On MacOS, just print the generated page and save to PDF. >>> >>> I think this only works with OSX. In the earlier MacOSs (OS 6 to OS9), >>> the print command will allow you to Save to file. This gives a >>> PostScript document which you can then convert to PDF with Distiller. >>> >> >> works just fine here on linux. Print to file defaults to a pdf, on Firefox. > > I don't understand the relevance of this reply. Neither Linux nor > Firefox can run under MacOS. > I don't undestand the relevance of this comment 1/. Firefox can run under MacOSX 2/. so can linux in a virtual machine 3/, "I think this only works with OSX." >> >>> Some MacOS applications such as PageMaker 6.5 have an option to export >>> as a PDF; but it isn't really a direct conversion, it still goes through >>> the PostScript- Distiller route. >>> >> >> shows how backward OSX is.. > > Again, I cannot see a connection betwen your reply and the preceding > comment, because PageMaker 6.5 is not an OSX application. > s/OSX/OS >>> >> >> However that's not what the OP wants. he doesn't want to involve the >> users browser. >> >> he wants to generate a pdf an the server. Or why else would he ask in a >> PHP newsgroup? > > I fully appreciate that; but I felt it was necessary to correct any > possible confusion between the behaviour of Mac OS and of OSX, which > could have misled others who read this group. > I doubt anyone but you even remembers what OS9 or earlier is, or does Even our PowerPcs here have at least OSX on them. I cant imagine anyone still runs it natively. And in any case the comments were directed at the person who said 'you can ONLY DO THAT ON OSX, not windows or Linux. As we have shown, that is incorrect., Certainly Linux, and probably windows can print to a PDF using a pdf print driver (for windoze). > -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) |
|---|---|
| Date | 2013-03-28 21:38 +0000 |
| Subject | Re: PHP: convert a page to pdf [OT] |
| Message-ID | <1l0goqo.oeyue6xvsn08N%adrian@poppyrecords.invalid.invalid> |
| In reply to | #8894 |
The Natural Philosopher <tnp@invalid.invalid> wrote: > On 28/03/13 19:14, Adrian Tuddenham wrote: > > The Natural Philosopher <tnp@invalid.invalid> wrote: > > > >> On 28/03/13 17:32, Adrian Tuddenham wrote: > >>> Michael Vilain <vilain@NOspamcop.net> wrote: > >>> > >>>> In article <a2b28350-6f57-43bc-935e-66a179409287@googlegroups.com>, > >>>> badmus aliu <bajab247@gmail.com> wrote: > >>>> > >>>>> can anyone help me on how to convert a database driven page to pdf > >>>> using php > >>>> > >>>> On MacOS, just print the generated page and save to PDF. > >>> > >>> I think this only works with OSX. In the earlier MacOSs (OS 6 to OS9), > >>> the print command will allow you to Save to file. This gives a > >>> PostScript document which you can then convert to PDF with Distiller. > >>> > >> > >> works just fine here on linux. Print to file defaults to a pdf, on Firefox. > > > > I don't understand the relevance of this reply. Neither Linux nor > > Firefox can run under MacOS. > > > > I don't undestand the relevance of this comment > > 1/. Firefox can run under MacOSX > 2/. so can linux in a virtual machine > 3/, "I think this only works with OSX." > > >> > >>> Some MacOS applications such as PageMaker 6.5 have an option to export > >>> as a PDF; but it isn't really a direct conversion, it still goes through > >>> the PostScript- Distiller route. > >>> > >> > >> shows how backward OSX is.. > > > > Again, I cannot see a connection betwen your reply and the preceding > > comment, because PageMaker 6.5 is not an OSX application. > > > s/OSX/OS > >>> > >> > >> However that's not what the OP wants. he doesn't want to involve the > >> users browser. > >> > >> he wants to generate a pdf an the server. Or why else would he ask in a > >> PHP newsgroup? > > > > I fully appreciate that; but I felt it was necessary to correct any > > possible confusion between the behaviour of Mac OS and of OSX, which > > could have misled others who read this group. > > > > I doubt anyone but you even remembers what OS9 or earlier is, or does > Even our PowerPcs here have at least OSX on them. I cant imagine anyone > still runs it natively. The post to which I replied said "MacOS", not "Mac OSX". To avoid any confusion I made the distinction between the two. From your comments about Firefox it appears that you regard OSX as the only Mac operating system and have fallen into the very trap I was trying to steer people away from. Mac OS 8 and 9 are still perfectly adequate for non-entertainment work and have many good features which were thrown away when Mac introduced OSX. And yes, I do run it natively on all but one of my machines. -- ~ Adrian Tuddenham ~ (Remove the ".invalid"s and add ".co.uk" to reply) www.poppyrecords.co.uk
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-03-28 22:30 +0000 |
| Subject | Re: PHP: convert a page to pdf [OT] |
| Message-ID | <kj2g92$brq$2@news.albasani.net> |
| In reply to | #8896 |
On 28/03/13 21:38, Adrian Tuddenham wrote: > > Mac OS 8 and 9 are still perfectly adequate for non-entertainment work > and have many good features which were thrown away when Mac introduced > OSX. And yes, I do run it natively on all but one of my machines. > How's your pet brontosauraus? -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) |
|---|---|
| Date | 2013-03-29 08:44 +0000 |
| Subject | Re: PHP: convert a page to pdf [OT] |
| Message-ID | <1l0hjp2.rte4bo90sg64N%adrian@poppyrecords.invalid.invalid> |
| In reply to | #8897 |
The Natural Philosopher <tnp@invalid.invalid> wrote: > On 28/03/13 21:38, Adrian Tuddenham wrote: > > > > > Mac OS 8 and 9 are still perfectly adequate for non-entertainment work > > and have many good features which were thrown away when Mac introduced > > OSX. And yes, I do run it natively on all but one of my machines. > > > How's your pet brontosauraus? As an engineer, my choices are based on what does the job best, not on what is currently fashionable. My car has pneumatic tyres (Dunlop 1888), my house is fitted with ordinary water taps (Brecknell 1859) and my video projector uses an arc lamp (Davy 1801). If you want to use the most up-to-date computer system, bear in mind that OSX is based on UNIX from 1969, whereas MacOS is much newer, having been first released in 1984. -- ~ Adrian Tuddenham ~ (Remove the ".invalid"s and add ".co.uk" to reply) www.poppyrecords.co.uk
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-03-29 12:59 +0000 |
| Subject | Re: PHP: convert a page to pdf [OT] |
| Message-ID | <kj4381$3kv$1@news.albasani.net> |
| In reply to | #8899 |
On 29/03/13 08:44, Adrian Tuddenham wrote: > The Natural Philosopher <tnp@invalid.invalid> wrote: > >> On 28/03/13 21:38, Adrian Tuddenham wrote: >> >>> >>> Mac OS 8 and 9 are still perfectly adequate for non-entertainment work >>> and have many good features which were thrown away when Mac introduced >>> OSX. And yes, I do run it natively on all but one of my machines. >>> >> How's your pet brontosauraus? > > As an engineer, my choices are based on what does the job best, not on > what is currently fashionable. My car has pneumatic tyres (Dunlop > 1888), my house is fitted with ordinary water taps (Brecknell 1859) and > my video projector uses an arc lamp (Davy 1801). > > If you want to use the most up-to-date computer system, bear in mind > that OSX is based on UNIX from 1969, whereas MacOS is much newer, > having been first released in 1984. > > all ultimately 'written' in machine code, which predates the lot of them. Sheesh. a religious nutcase. "Olde is better" (cf tyres) "New is better" Cf OS9). cant you come up with something better than that? like " *nix had proper pre-emptive multi tasking years before os9 and windows failed to implement it correctly" -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2013-03-29 13:18 +0000 |
| Subject | Re: PHP: convert a page to pdf [OT] |
| Message-ID | <timstreater-CB7A74.13184129032013@news.individual.net> |
| In reply to | #8904 |
In article <kj4381$3kv$1@news.albasani.net>, The Natural Philosopher <tnp@invalid.invalid> wrote: > cant you come up with something better than that? like " *nix had proper > pre-emptive multi tasking years before os9 and windows failed to > implement it correctly" And plenty of OSes had it before unix. So your point is *what* precisely? -- Tim "That excessive bail ought not to be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2013-03-29 15:01 +0100 |
| Subject | [OT] Pre-emptive multi-tasking (was: PHP: convert a page to pdf [OT]) |
| Message-ID | <1905400.vG1O3Ob32A@PointedEars.de> |
| In reply to | #8905 |
Tim Streater wrote: > The Natural Philosopher <tnp@invalid.invalid> wrote: >> cant you come up with something better than that? like " *nix had proper >> pre-emptive multi tasking years before os9 and windows failed to >> implement it correctly" > > And plenty of OSes had it before unix. No, according to <http://en.wikipedia.org/wiki/Pre- emptive_multitasking#Systems_supporting_preemptive_multitasking> and <http://en.wikipedia.org/wiki/Unix>, Unix, at Bell Labs, was the first operating system to support *pre-emptive* _multi-tasking_, in 1969/1970 (hence the Unix timestamp 0 equals 1970-01-01 00:00:00 UTC) as an improvement to the time-sharing Multics (1964) where multi-tasking was first implemented. Sinclair QDOS (1984) and Amiga OS (1985) and other operating systems (particularly the Unix-like ones) followed Unix in that regard. PointedEars -- Sometimes, what you learn is wrong. If those wrong ideas are close to the root of the knowledge tree you build on a particular subject, pruning the bad branches can sometimes cause the whole tree to collapse. -- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2013-03-29 16:57 +0000 |
| Subject | Re: [OT] Pre-emptive multi-tasking (was: PHP: convert a page to pdf [OT]) |
| Message-ID | <timstreater-20CA2B.16573129032013@news.individual.net> |
| In reply to | #8907 |
In article <1905400.vG1O3Ob32A@PointedEars.de>, Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote: > Tim Streater wrote: > > > The Natural Philosopher <tnp@invalid.invalid> wrote: > >> cant you come up with something better than that? like " *nix had proper > >> pre-emptive multi tasking years before os9 and windows failed to > >> implement it correctly" > > > > And plenty of OSes had it before unix. > > No, according to <http://en.wikipedia.org/wiki/Pre- > emptive_multitasking#Systems_supporting_preemptive_multitasking> and > <http://en.wikipedia.org/wiki/Unix>, Unix, at Bell Labs, was the first > operating system to support *pre-emptive* _multi-tasking_, in 1969/1970 > (hence the Unix timestamp 0 equals 1970-01-01 00:00:00 UTC) as an > improvement to the time-sharing Multics (1964) where multi-tasking was first > implemented. Sinclair QDOS (1984) and Amiga OS (1985) and other operating > systems (particularly the Unix-like ones) followed Unix in that regard. My timeline had unix starting in the 70s but no matter. Certainly the OS I was using 1970-78 at CERN, running on a French-built Sigma7 and called Siris7, had pre-emptive multitasking. And I'm not sure that the Atlas Supervisor (1962) didn't do it too. The concepts were all there by that point for anyone to organise into an OS, which we did once or twice in our group at CERN. -- Tim "That excessive bail ought not to be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-03-29 17:13 +0000 |
| Subject | Re: [OT] Pre-emptive multi-tasking |
| Message-ID | <kj4i45$61q$1@news.albasani.net> |
| In reply to | #8910 |
On 29/03/13 16:57, Tim Streater wrote: > In article <1905400.vG1O3Ob32A@PointedEars.de>, > Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote: > >> Tim Streater wrote: >> >> > The Natural Philosopher <tnp@invalid.invalid> wrote: >> >> cant you come up with something better than that? like " *nix had >> proper >> >> pre-emptive multi tasking years before os9 and windows failed to >> >> implement it correctly" >> > > And plenty of OSes had it before unix. >> >> No, according to <http://en.wikipedia.org/wiki/Pre- >> emptive_multitasking#Systems_supporting_preemptive_multitasking> and >> <http://en.wikipedia.org/wiki/Unix>, Unix, at Bell Labs, was the first >> operating system to support *pre-emptive* _multi-tasking_, in >> 1969/1970 (hence the Unix timestamp 0 equals 1970-01-01 00:00:00 UTC) >> as an improvement to the time-sharing Multics (1964) where >> multi-tasking was first implemented. Sinclair QDOS (1984) and Amiga >> OS (1985) and other operating systems (particularly the Unix-like >> ones) followed Unix in that regard. > > My timeline had unix starting in the 70s but no matter. Certainly the OS > I was using 1970-78 at CERN, running on a French-built Sigma7 and called > Siris7, had pre-emptive multitasking. And I'm not sure that the Atlas > Supervisor (1962) didn't do it too. > multitasking goes back a long way but pre-emptive does not go back as far. Certainly Unix was one of the earliest , but that may have been because the hardware it came on had the right sort of interrupts. > The concepts were all there by that point for anyone to organise into an > OS, which we did once or twice in our group at CERN. > Indeed. I've written a couple of schedulersto do pre-emptive multitasking..one on DOS2.2!!! there isn't much need to turn ordinary multitasking into pre-emptive, but there is not much point in doing it until you have users with terminals, rather than teletypes. For batch work you might as well use IO wait to context switch, or co-operative multitasking. And the idea of a computer with a CRT and keyboard is a late 60s early 70s one. -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2013-03-29 17:20 +0000 |
| Subject | Re: [OT] Pre-emptive multi-tasking |
| Message-ID | <timstreater-95D1AE.17200229032013@news.individual.net> |
| In reply to | #8911 |
In article <kj4i45$61q$1@news.albasani.net>, The Natural Philosopher <tnp@invalid.invalid> wrote: > And the idea of a computer with a CRT and keyboard is a late 60s early > 70s one. Which I used for my DIC - and while doing that I managed to crash all of CERN's central computers in 1970 by typing two characters. -- Tim "That excessive bail ought not to be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-03-29 14:41 +0000 |
| Subject | Re: PHP: convert a page to pdf [OT] |
| Message-ID | <kj4971$ggr$2@news.albasani.net> |
| In reply to | #8905 |
On 29/03/13 13:18, Tim Streater wrote: > In article <kj4381$3kv$1@news.albasani.net>, > The Natural Philosopher <tnp@invalid.invalid> wrote: > >> cant you come up with something better than that? like " *nix had >> proper pre-emptive multi tasking years before os9 and windows failed >> to implement it correctly" > > And plenty of OSes had it before unix. So your point is *what* precisely? > well exactly. Good ideas live on., bad ideas like OS9, die rapidly. -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.php
csiph-web