www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Working with pdf

reply "Kingsley" <kingsley.hendrickse gmail.com> writes:
Hi

Can anyone recommend any ways of pdf creation using D.

I am generating an HTML and JavaScript page but I would like it 
in pdf format as well.
Jul 30 2015
next sibling parent "Andy Smith" <andyrsmith googlemail.com> writes:
On Thursday, 30 July 2015 at 11:19:48 UTC, Kingsley wrote:
 Hi

 Can anyone recommend any ways of pdf creation using D.

 I am generating an HTML and JavaScript page but I would like it 
 in pdf format as well.
Hi Kingsley, Python reportlab via PyD maybe? Obviously not as good as pure d solution ( or even a D linked to some C lib), but if matplotlib can be driven from D I'm sure reportlab can as well. I've played with it a bit it's relatively easy to pick up. Lots of examples you can hack^H^H^H^H 'tailor' to your needs :-) Cheers, A.
Jul 30 2015
prev sibling next sibling parent reply Daniel =?UTF-8?B?S296w6Fr?= via Digitalmars-d writes:
I use wkhtmltopdf:
http://wkhtmltopdf.org

On Thu, 30 Jul 2015 11:19:45 +0000
Kingsley via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 Hi
 
 Can anyone recommend any ways of pdf creation using D.
 
 I am generating an HTML and JavaScript page but I would like it 
 in pdf format as well.
Jul 30 2015
parent "Kingsley" <kingsley.hendrickse gmail.com> writes:
On Thursday, 30 July 2015 at 12:01:55 UTC, Daniel Kozák wrote:
 I use wkhtmltopdf:
 http://wkhtmltopdf.org

 On Thu, 30 Jul 2015 11:19:45 +0000
 Kingsley via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 Hi
 
 Can anyone recommend any ways of pdf creation using D.
 
 I am generating an HTML and JavaScript page but I would like 
 it in pdf format as well.
This one I'm having the most success with thanks :)
Jul 30 2015
prev sibling next sibling parent "Adrian Matoga" <epi atari8.info> writes:
On Thursday, 30 July 2015 at 11:19:48 UTC, Kingsley wrote:
 Hi

 Can anyone recommend any ways of pdf creation using D.

 I am generating an HTML and JavaScript page but I would like it 
 in pdf format as well.
Another indirect solution would be to generate PostScript (there's no existing lib in D that I know of, but I did it in plain C++ some time ago and it wasn't that unpleasant) and then convert it using something like ps2pdf.
Jul 30 2015
prev sibling next sibling parent "JN" <666total wp.pl> writes:
On Thursday, 30 July 2015 at 11:19:48 UTC, Kingsley wrote:
 Hi

 Can anyone recommend any ways of pdf creation using D.

 I am generating an HTML and JavaScript page but I would like it 
 in pdf format as well.
http://libharu.org/ could try this, haven't used it myself but Wt Toolkit (C++ web toolkit) uses it for PDF generation and it's written in C so should be trivial to embed in a D application.
Jul 30 2015
prev sibling next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Thursday, 30 July 2015 at 11:19:48 UTC, Kingsley wrote:
 Hi

 Can anyone recommend any ways of pdf creation using D.

 I am generating an HTML and JavaScript page but I would like it 
 in pdf format as well.
I don't know of any pdf handling libraries in D Definitely check first to see if a command-line tool can do it well enough for you from the html. After that, it would be using another language e.g. via luaD, pyd or just linking to C.
Jul 30 2015
prev sibling parent reply "tcak" <1ltkrs+3wyh1ow7kzn1k sharklasers.com> writes:
On Thursday, 30 July 2015 at 11:19:48 UTC, Kingsley wrote:
 Hi

 Can anyone recommend any ways of pdf creation using D.

 I am generating an HTML and JavaScript page but I would like it 
 in pdf format as well.
In 2013, I had started developing a module to create PDF files based on version 1.5 specification, but it had started being too complex to handle, and I needed to continue working. I don't know where it is now. If you are on *unix systems though, you can use Cairo library for this I guess.
Jul 30 2015
parent =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 07/30/2015 08:39 AM, tcak wrote:

 I had started developing a module to create PDF files based on
 version 1.5 specification, but it had started being too complex to
 handle
I looked at that option for my book, which is written in DDOC to generate HTML. Yes, PDF and layout issues in general are very complicated. :( I ended up using Prince XML, which is known to be one of the best tools out there. It is free for personal use (check license before committing as it is expensive otherwise): http://www.princexml.com/ Ali
Jul 30 2015