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

eZ debug

Timing: Jan 20 2025 02:25:59
Script start
Timing: Jan 20 2025 02:25:59
Module start 'content'
Timing: Jan 20 2025 02:25:59
Module end 'content'
Timing: Jan 20 2025 02:25:59
Script end

Main resources:

Total runtime0.1707 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 588.9609180.8281
Module start 'content' 0.00750.0079 769.7891102.0078
Module end 'content' 0.01530.1553 871.7969530.7969
Script end 0.1706  1,402.5938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00362.1369200.0002
Check MTime0.00150.8595200.0001
Mysql Total
Database connection0.00100.581210.0010
Mysqli_queries0.117168.60871410.0008
Looping result0.00130.73861390.0000
Template Total0.154990.710.1549
Template load0.00090.553710.0009
Template processing0.153990.176810.1539
Override
Cache load0.00060.351610.0006
Sytem overhead
Fetch class attribute can translate value0.00080.448810.0008
XML
Image XML parsing0.00030.154110.0003
General
dbfile0.00995.8101200.0005
String conversion0.00000.003530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs