# Cannot get right page size with TCPDF

**URL:** <https://www.dolibarr.org/forum/t/cannot-get-right-page-size-with-tcpdf/7226>\
**Category:** Using my Dolibarr\
**Created:** [July 14, 2011, 5:15pm UTC](https://www.dolibarr.org/forum/t/cannot-get-right-page-size-with-tcpdf/7226 "2011-07-14T17:15:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rody](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/rody/32/180_2.png) [@Rody](https://www.dolibarr.org/forum/u/Rody)\
**Post date:** [July 14, 2011, 5:15pm UTC](https://www.dolibarr.org/forum/t/cannot-get-right-page-size-with-tcpdf/7226/1 "2011-07-14T17:15:06Z")

</div>

Hi Eldy,

I am trying to upgrade from 2.9.0 to 3.0.0 but have some trouble updating my previous modifications I made.

Basically I was using “pdf\_expedition\_merou.modules” and transformed this into an A4 size with some other modifications.

Now whatever I try I cannot get the A4 size, nomatter what I try with the dimensions the page stays on a horizontal format…

Have attached my modifications and hope you or somebody else can take a look to see if you can see the problem.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![eldy](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/eldy/32/12_2.png) [@eldy](https://www.dolibarr.org/forum/u/eldy)\
**Post date:** [July 17, 2011, 8:26pm UTC](https://www.dolibarr.org/forum/t/cannot-get-right-page-size-with-tcpdf/7226/2 "2011-07-17T20:26:00Z")

</div>

Did you do this into constructor:

```
	$this-\>page_largeur = 210;
	$this-\>page_hauteur = 297;
	$this-\>format = array($this-\>page_largeur,$this-\>page_hauteur);

```

Then to build pdf instance, you do  
$pdf=pdf\_getInstance($this-\>format);

---

<div class="post-metadata">

**Author:** ![Rody](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/rody/32/180_2.png) [@Rody](https://www.dolibarr.org/forum/u/Rody)\
**Post date:** [July 18, 2011, 8:19am UTC](https://www.dolibarr.org/forum/t/cannot-get-right-page-size-with-tcpdf/7226/3 "2011-07-18T08:19:48Z")

</div>

Hi Eldy,

Thanks for your help.  
Adding $pdf=pdf\_getInstance($this-\>format); did the trick, thank you.
