Re: [Plplot-devel] pdf driver

2006-12-30 Thread Werner Smekal
Hi Andrew,

 Nice !
 
 About five years ago I wrote a PDF driver using a PDF library whose source 
 code was available, but wasn't Open Source - rather some unusual licence - 
 so shelved it. I looked at libharu as an alternative when they first 
 released it, but at the time it was dependent on C++, so I didn't pursue it 
 at all. Having looked at their web page just now, it seems that version 2 
 is ANSI C - is that right ? Or does it still have dependencies with C++ ?

No, there are no dependencies on C++ anymore. It's in ANSI C and it 
seems to compile on all compilers without problems.
 
 2) The paper size is hardcoded to A4 in the moment - good for Europeans,
 bad for anybody else, I need to add some flags for other formats.
 
 A4 is probably best for everyone EXCEPT North Americans, so don't feel bad 
 about that !

Yes, you are right :)
 
 Might I also suggest letting the user set their own explicit page 
 dimensions using plplot's regular command line options as well as flags for 
 pre-defined sizes ?

Sure. This should be no probmen at all - I'll also have a look at the 
psc driver how it is done there.

-Werner

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] pdf driver

2006-12-30 Thread Werner Smekal
Hi Alan,

 Here is what I did.
 
 * Unpack, configure, build, and install libharu-2.0.8
[...]
 * However the pdf device part of the build did not work:
[...]
 Werner, let me know if you need any more information to duplicate this
 pdf device build error on your Linux box with libharu-2.0.8.

I think I know where the problem is and will fix it, the next time I 
boot into Kubuntu. Dual booting is a pain ;)

 libharu seems mature; the 1.0.0 version was released in 2003, and there has
 been a steady series of releases ever since.  I understand there are few
[...]
 libLASI). Werner, once you solve the Linux build issue, I suggest you donate
 your fix to the developer of this package to see how he cooperates.

I actually think the problem is on our (cmake module) side, it is not a 
bug in libharu, we'll see, but if it's a bug I'll contact him (there 
seems to be also another bug, so I'll contact him anyway).

 For the Linux brochure project (lbproject.sf.net) I get satisfactory
 conversions from postscript to pdf results using ps2pdf.  Thus, you may want
 to compare -dev pdf results with -dev psc or psttfc results that have been
 transformed by ps2pdf on your Linux box.

Will do that. I know, that one could use ps2pdf, but than it's an 
additional step and not easily available on Windows.
 
 However, your device should ultimately give better results since generic
 postscript to pdf transforms (regardless of whether done with ps2pdf on
 Linux or some equivalent tool on windows) will likely miss out on some pdf
 features you can get with a native pdf device driver.
 
 Adding TrueType fonts (I checked that libharu claims to support those) will
 be essential for -dev pdf users, and the compression feature you mentioned
 would be nice as well.  But the top priority is the Linux fix.

I have an idea how to manage the 3rd party libraries problem, especially 
on Windows it needs now a big amount of time to get everything ready if 
you want to include all. I'll write an another email soon.

-Werner

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] pdf driver

2006-12-30 Thread Werner Smekal
Hi Alan,

 Werner, let me know if you need any more information to duplicate this
 pdf device build error on your Linux box with libharu-2.0.8.

I think I fixed it, though I haven't been to Linux yet. I'll do that 
tomorrow. If you have time, you can give it a try again.

-Werner

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] pdf driver

2006-12-30 Thread Alan W. Irwin
On 2006-12-30 23:20+0100 Werner Smekal wrote:

 Hi Alan,

 Werner, let me know if you need any more information to duplicate this
 pdf device build error on your Linux box with libharu-2.0.8.

 I think I fixed it, though I haven't been to Linux yet. I'll do that 
 tomorrow. If you have time, you can give it a try again.

Thanks, Werner.  That was a good catch.  The Linux build error is now gone,
and the only apparent build issue remaining is the following warning:

/home/software/plplot_cvs/HEAD/plplot_cmake/drivers/pdf.c:162: warning:
passing arg 1 of HPDF_New' from incompatible pointer type.  However, that
did not seem to affect the results with this device.

I installed and did a superficial install-tree test
using c/x01c -dev pdf -o test.pdf

When the resulting test.pdf file was viewed with the gv application, there
appeared to be an overgenerous bounding box, but otherwise the rendering
looked okay including the black background that is supposed to be there.

A similar test with the xpdf pdf viewer showed the same bounding-box issue
and a white (!) background.  This might be an issue with how -dev pdf
creates the background colour of the plot because if I use -dev psc and
transform the result to pdf using ps2pdf, xpdf renders that transformed
result with the correct black background.  So it appears xpdf can render the
background colour correctly, but it is sensitive to exactly how that
background colour is created.

Anyhow, it seems your new pdf device is a good start, and I suggest you will
want to include this device as an option in plplot-test.sh so we can easily
generate pdf's for all install-tree examples as a test of -dev pdf.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


[Plplot-devel] pdf driver

2006-12-29 Thread Werner Smekal
Hi,

while working on a plot for my thesis I thought it would be cool to have 
pdf output. I was googling around and found a free pdf library (zlib 
license) in ANSI C, working on all major platforms:

http://libharu.sourceforge.net/index.html

So I took the svg driver, rewrote it for the pdf library, wrote some 
cmake modules and ready I was (after some hours :).

To use this driver we need first to install it (configure/make/make 
install for Linux, and make -f script/Makefile.??? for Windows) and set 
the environment variables for cmake accordingly so that cmake can find it:

set HPDFDIR=%USER_ROOTDIR%\libharu-2.0.8
set PATH=%HPDFDIR%;%PATH%  (for windows dll)
set CMAKE_INCLUDE_PATH=%HPDFDIR%\include;%CMAKE_INCLUDE_PATH%
set CMAKE_LIBRARY_PATH=%HPDFDIR%;%CMAKE_LIBRARY_PATH%

There seems to be no debian/rpm package of this library, so Linux users 
need to compile this library as well.

Than run cmake with -DPLD_pdf=ON (since it is disabled by default) and 
off we go.

Five remarks:
1) in pdf.cmake is a compile flag added which won't work for Unix 
-DHPDF_DLL - this I need to change.
2) The paper size is hardcoded to A4 in the moment - good for Europeans, 
bad for anybody else, I need to add some flags for other formats.
3) the font used is only the hershey fonts in the moment - on the basis 
of the svg driver I should be able to add nice fonts.
4) I didn't test the driver on Linux yet, but I don't expect much problems.
5) Output is not compressed in the moment, since I need zlib for Windows 
as well (not too much problem), so expect big files - but the driver is 
actually very fast.

I hope this driver is useful - if my choice of the pdf library is not 
welcome, there is not much problems using another one - if there is 
another library which suits our needs better.

Regards,
Werner

-- 
Dipl. Ing. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: [EMAIL PROTECTED]
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
+43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] pdf driver

2006-12-29 Thread Andrew Roach
At 10:53 PM 29/12/2006 +0100, you wrote:
Hi,

while working on a plot for my thesis I thought it would be cool to have
pdf output. I was googling around and found a free pdf library (zlib
license) in ANSI C, working on all major platforms:

http://libharu.sourceforge.net/index.html

Nice !

About five years ago I wrote a PDF driver using a PDF library whose source 
code was available, but wasn't Open Source - rather some unusual licence - 
so shelved it. I looked at libharu as an alternative when they first 
released it, but at the time it was dependent on C++, so I didn't pursue it 
at all. Having looked at their web page just now, it seems that version 2 
is ANSI C - is that right ? Or does it still have dependencies with C++ ?


2) The paper size is hardcoded to A4 in the moment - good for Europeans,
bad for anybody else, I need to add some flags for other formats.

A4 is probably best for everyone EXCEPT North Americans, so don't feel bad 
about that !

Might I also suggest letting the user set their own explicit page 
dimensions using plplot's regular command line options as well as flags for 
pre-defined sizes ?

-Andrew



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel