Categories > OpenTBS with DOCX >

Re: html2pdf in tinybutstrong

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Sandeep Chauhan
Date: 2013-05-30
Time: 11:48

Re: html2pdf in tinybutstrong

Hi,
How can I convert html to PDF using OpenTBS. I have a html file and now want to convert it into PDF same as HTML file. Please let me know how can I convert it into pdf using OpenTBS.

Please help me.

Thanks,
Sandeep
By: Skrol29
Date: 2013-05-31
Time: 01:56

Re: html2pdf in tinybutstrong

Hi,

I've put the message in a new thread.

OpenTBS can handle LibreOffice or Ms Office document.
For HTML documents you should use TinyButStrong without OpenTBS.
You can convert HTML to PDF using Htlm2Pdf, but there is no PHP solution I know that convert LibreOffice or Ms Office documents to PDF.
By: Sandeep Chauhan
Date: 2013-05-31
Time: 06:19

Re: html2pdf in tinybutstrong

Hi,
Application is working on CentOS linux server and I am converting docx to pdf using OpenTBS and Libreoffice, jodconverter. First I am making docx using template from Opentbs and then convert it into PDF using jodconverter from command line. It is using Libreoffice when it is converting .docx to pdf from command line. Now .docx data is not showing properly in libreoffice for example I have two name ABC and XYZ. these names are showing in docx as below:
ABC
XYZ
But When I am opening .docx file in LIbreoffice then showing as below:
ABCXYZ 
So after converting it to pdf, it is showing same(ABCXYZ) in PDF. But I need it same as .docx. Please let me know if you have any confusion on it.

Please help me on this issue.

Thanks,
By: Skrol29
Date: 2013-06-01
Time: 00:33

Re: html2pdf in tinybutstrong

Hi Sandeep,

I'm sorry and afraid I connot help on this.
I don't know Ms Office / LibreOffice compatibility, nor  LibreOffice / PDF conversion.

Why can't you use an ODT template instead of DOCX ?
By: Sandeep
Date: 2013-06-01
Time: 06:18

Re: html2pdf in tinybutstrong

Hi,
Thanks your reply.

I can't use ODT template because OpenTBS is not supporting column merging vertically like that docx. This is the reason for using docx for converting in PDF.
Can you please help me for column merging vertically in ODT?

Thanks in advance.
Sandeep
By: Skrol29
Date: 2013-06-02
Time: 01:58

Re: html2pdf in tinybutstrong

Hi Sandeep,

It is possible to merge cells vertically in an ODT, but you need to prepare your data before that.

That preparation cannot be done by SQL, so you have to use a PHP array.

Add a column "rowspan" in your records.
The rowspan value must be "1" if the cell is not merged for the record.
The rowspan value must be "2" if the cell is merged with the next cell (next record). It works just like the "colspan" attribute of HTML. Put value 3 is 3 cells are merged, and so one...
The rowspan value must be "" (empty string) if the cell is merged with a previous one (and so is it covered).

Then you just have to insert the following TBS field in the cell to merge, next to the TBS field displaying data (assuming the block is named 'a'):
[a.colspan;att=table:table-cell#table:number-rows-spanned;magnet=tbs:cell]


Example of data merging 3 cells:
$data = array();
$data[] = array('title'=> 'AAA',           'value'=>'11', 'colspan'=>"1");
$data[] = array('title'=> 'BBB (merged)',  'value'=>'22', 'colspan'=>"3");
$data[] = array('title'=> 'BBB (covered)', 'value'=>'33', 'colspan'=>"");
$data[] = array('title'=> 'BBB (covered)', 'value'=>'44', 'colspan'=>"");
$data[] = array('title'=> 'DDD',           'value'=>'55', 'colspan'=>"1");
$data[] = array('title'=> 'EEE',           'value'=>'66', 'colspan'=>"1");


By: Sandeep
Date: 2013-06-02
Time: 10:04

Re: html2pdf in tinybutstrong

Hi,
Thanks your reply.

I am confused in rowspan and colspan because you said to set rowspan above but you have used colspan in example and TBS field. Also I am sending email with data array and template which is using in my apps for your reference.

Again Thanks for your supporting.

Sandeep 
By: Sandeep
Date: 2013-06-04
Time: 13:50

Re: html2pdf in tinybutstrong

Hi,
I have try to make that kind of array where I am using foreach loop. But it is not making that kind of array. is it possible in PHP? Please help me anyone if it is possible.

Thanks in advance.

Sandeep
By: Skrol29
Date: 2013-06-04
Time: 14:23

Re: html2pdf in tinybutstrong

> I am confused in rowspan and colspan because you said to set rowspan above but you have used colspan in example and TBS field

I agree, you can rename it "rowspan" or even better "cellspan".

> I have try to make that kind of array where I am using foreach loop.
> But it is not making that kind of array. is it possible in PHP?

Newbie to PHP ? You need to give more detail of your own PHP array.