Re: How to include HTML or PDF in plot

Kristof Koch <[email protected]> Sat, 19 Apr 2014 06:53:23 +0200
Newsgroups gmane.comp.gis.gmt.user
Message-ID <[email protected]>
Hi Eduardo,

thank you for pointing me to the PHP PS library. After reading some of the documentation it seems to be a very powerful library which gives me full control over every tiny aspect of the file. I have to admit I'm not that keen on having to learn all the tricks and caveats of basic PostScript generation and hoped for an easier solution. 

Some basic experimenting with TCPDF and pdftops showed good stability in the overall appearance of the table I'm generating, but as space is tight (see cropped image in my original mail) the conversions are not precise enough. Maybe I can fine tune this, but for the moment it looks like I have to start learning PostScript generation from scratch. 

Regarding the tricks & techniques used in my plot: If there's interest I'm more than happy to share those as I learnt lots of them from the generous support I received on this list. 

Regards,
Kristof 

> Am 18.04.2014 um 17:39 schrieb "Eduardo A. Suárez" <[email protected]>:
> 
> Hi Kristof,
> 
> if you need print (E)PS from HTML/PHP you can use a PHP library like http://www.php.net/manual/en/book.ps.php
> 
> Regards, Eduardo.-
> 
> PD: at some point, when your done, I'd like you to tell us all the tricks you used to make your plot :)
> 
> Quoting Kristof Koch <[email protected]>:
> 
>> Dear list,
>> 
>> the chart I'm plotting requires quite an extensive table of database  driven information to be present on the left side of the plot.  Currently I'm achieving this with a fair amount of Bash and pslegend  magic.
>> 
>> It's a bit limited concerning the formatting of the data. For  example changing background color of a line is impossible. I thought  about generating the table outside of the GMT-suite and insert it  via psimage. Unfortunately psimage takes only .ras and .eps as  input. The workflow I came up with (non working at the moment) is
>> 
>> HTML & CSS > convert with "TCPDF" > PDF > convert with "pdftops" >  EPS > plot with psimage
>> 
>> I'm sure I'll get in trouble with so much converting and bounding  boxes being treated differently in different programs. There must be  an easier way but I didn't find it so far.
>> 
>> How would you tackle the problem?
>> 
>> All the best,
>> Kristof Koch
>> 
>> 
>> 
>> 
>> TCPDF: http://www.tcpdf.org/index.php
>> pdftops: http://poppler.freedesktop.org
>> Why pdftops and not pdf2ps: http://stefaanlippens.net/pdf2ps_vs_pdftops
>> 
>> Sample of the data driving pslegend:
>> 
>> N 2
>> L 7p 40 L @:6.5p:BGBW@::
>> L 7p 39 R 112ft / nil
>> N 9
>> L 7p 39 L N
>> L 7p 39 L 07
>> L 7p 39 L \040
>> L 7p 39 L \040
>> L 7p 39 C 1.8x45
>> L 7p 39 R \040
>> L 7p 39 R \040
>> L 7p 39 R 25
>> L 7p 39 R -
>> N 2
>> L 7p 40 L @:6.5p:BGSF@::
>> L 7p 39 R 165ft / 5-8
>> N 9
>> L 7p 39 L L
>> L 7p 39 L 09
>> L 7p 39 L \040
>> L 7p 39 L \040
>> L 7p 39 C 2.8x60
>> L 7p 39 R \040
>> L 7p 39 R \040
>> L 7p 39 R 27
>> L 7p 39 R C
>> ...
>> 
>> Sample crop of current solution:
>> 
>> 
>> To unsubscribe, send the message "signoff gmt-help" to  [email protected]
> 
> 
> 
> -- 
> Eduardo A. Suarez
> Facultad de Ciencias Astronómicas y Geofísicas - UNLP
> FCAG: (0221)-4236593 int. 172/Cel: (0221)-15-4557542/Casa: (0221)-4526589
> 
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> 
> To unsubscribe, send the message "signoff gmt-help" to [email protected]

To unsubscribe, send the message "signoff gmt-help" to [email protected]