Text wrap in Hdr and Cells for PDF Export

I have 3 questions please:

  1. How can I control page orientation (Portrait/Landscape) in ‘toPDF’ function?

  2. Will ‘toPDF’ function in php support the ability to wrap text which is larger than column size in both hdr and cells? If ‘yes’ where can I get info on how to do this?

  3. Will the ‘online service’ support the above functions? If ‘yes’ where can I get info?

Thx in advance

Sorry keep forgetting to mention that we use Ver 3.6 Pro.

(2) The default implementation does not provide such kind of functionality. As far as I can see, it is possible to customize the code and implement such behavior, but it will be a rather complicated customization.

(1) Can be configured in the code of generate.php

$pdf = new gridPdfGenerator(); $pdf->orientation = 'L'; //or P

(3) It works the same as the standalone edition.

Hi Stanislav, thanks very much for your answers.

I was reading some of the other posts and it looked like the php version allowed for multi-line texts in the hdr and in the cells. However I couldn’t find anything in the documentation.

If I use the ‘on-line’ version then how do I configure for Portrait or Landscape please?

Stanislav the following post shows an example of multi-line text in cells at least.

viewtopic.php?f=23&t=31228

You can configure some fixed value of row height and header height, so multiple lines of text will be able to fit in one row of export file, but it is not an auto-size, just some fixed value for all rows and all header lines.

Thanks Stanislav. I understand.

Is the ability to configure Page Orientation and Line height ONLY available if I use my own php server or is there a way of doing it for the ‘on-line’ service as well?

Sorry Stanislav, looking at the example in the above link it does appear that at least for data rows the row height is automatic. Please look at the last 2 rows of that example compared to the first 2.

Sorry, I really was wrong.

For data rows, export service uses the default rowHeight value as minimum. During row rendering code checks for a text content of each cell and calculates the height based on the max height necessary to fit the content. It works for data part only and doesn’t work for headers.

Technically it can possible to use a similar approach for header cells, as core lib allows to calculae the height of content before rendering.

You can check getMaxRowHeight method in the gridPDFWrapper.php. Similar code can be created for header and called from headerDraw method.

Thanks for that Stanislav. Please can you tell me whether all this is only possible by running our own php server or will the ‘on-line’ service also handle this? I did try the on-line service but it didn’t automatically change row height. Perhaps I need to send it some extra parameters?

Thanks for all your help.

Online service uses Java version which works a bit differently. ( It uses JavaPDF library that provides a bit different set of features ).

Aaah ok thx Stanislav. I guess I’ll have to implement my own php server.

One final question. I use ver 3.6pro. What version of the php zip file do I need? Please can you either attach it here or point me to a url.

Thx again for all your quick responses.

The latest PHP export service is attached.
It will work with both dhtmlx 3.6 and dhtmlx 4.2
grid-excel-php.zip (788 KB)

Thx Stanislav. The name of the file says grid-excel. Will it also do pdfs or do I need a different one. I’m more interested in the pdf.

Sorry. Latest grid-to-pdf files are attached.
grid-pdf-php.zip (980 KB)

Thx a TON Stanislav. Very much appreciated.