Forums / Developer / TIP : table align in pdf templates...

TIP : table align in pdf templates...

Author Message

Jean-Yves Zinsou

Monday 02 March 2009 1:12:20 pm

I have been looking around in this forum and did not find any topic concerning my problem... I found a solution, i post it here, just in case someone else needs it.

By default tables are centered in pdf templates when you use pdf(table,....).
There are two undocumented options that lets you align your table to left, center or right.

* xPos
* xOrientation

The following code lets you align your table to the left :

 
{pdf(table,$rowdata,hash('showLines',0,'width',200,'xPos','left','xOrientation','left'))}   
 

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

Anita H

Monday 30 March 2009 4:24:55 am

Hi Jean-Yves,
just reading your tip and wondering whether you could help me: I'm trying to export pages to PDF but really am kind of lost.

I'd like to use the PDF creation instead of print view. Do you have experience in how to achieve that with ezPublish? If yes, could you guide me?

Many thanks
Anita

Yannick Komotir

Monday 30 March 2009 7:15:56 am

Hi,

what do you want exactly ? i work on it there are somedays ago perhaps i can help too !

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

justin kazadi

Monday 30 March 2009 7:37:22 am

Hi anita,
do you want to make an PDF export of the content of an node? it means that you have an article for example in ez publish an you want to export it in pdf.
to export an node in pdf do this:

www.your_domaine.com/content/pdf/node_id

i think this can help you.
good luck

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Anita H

Monday 30 March 2009 10:51:47 pm

Hi All,

exactly, I need to export content into a PDF, yet the content is not a single article but numerous objects of a folder which I need to export (loop over) plus, at the end of the PDF, the google map in landscape format.

I tried your tip: /content/pdf and used override.ini.append for defining another PDF template and this seems to work:

override.ini.append:
[t_pdf]
Source=/content/pdf/full.tpl
MatchFile=t_pdf.tpl
Subdir=templates

and then I used the following URL as an example:
<a href={concat('/content/pdf/', $node.node_id)|ezurl}>PDF</a>

However, now I need to digg into the topic of formating the PDF as it looks pretty poor:
The objects need to be displayed in 2 columns, with boxes around each content and a little image (page layout: portrait). At the end of the document I need to add the google map with the dynamically generated markers on it, paper size A4, landscape.

Happy for all help as I'm struggeling with this since a bit...
many thanks
Anita

Jean-Yves Zinsou

Tuesday 31 March 2009 4:20:52 am

Yes, pdf is really a struggle.

I use this links to work on it :
http://ez.no/ezpublish/documentation/incoming/pdf_export_tutorial

and
http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_pdf_functions

The "deprecated " functions means that they might be changed someday, somehow ...

Hope this helps

Jey

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr