Forum


Replies: 6   Views: 3952
Convert docx to pdf whilst not losing line number
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by acunnington  · 15-05-2014 - 13:57

Hi,



Is it possible to convert a DOCX to a PDF without losing the line numbers? They're quite important so we can't afford to lose them.



Thanks,

Harry


Posted by jorgelj  · 16-05-2014 - 08:56

Hello,



What do you mean by 'line numbers'? Please post a screenshot or a docx example.



Regards.


Posted by acunnington  · 16-05-2014 - 10:54

Hi again,



To save some time, I will just show the code that generates it. If you NEED a screenshot/file, I will upload in due course.




$lineNumberingOptions = array(
'countBy' => 5,
'start' => 1,
'restart' => 'newPage'
);
$docx->addLineNumbering($lineNumberingOptions);


Thanks,

Harry


Posted by jorgelj  · 19-05-2014 - 10:43

Hello,



Please attach a DOCX to show the issue. We'd lke to test it.



Regards.


Posted by acunnington  · 20-05-2014 - 11:51

Hi,



I have uploaded the file here: http://www.sendspace.com/file/r7izks



I edited the text to lorem ipsum as I cannot share, but it's only to show the line numbers.



Thanks,

Harry


Posted by jorgelj  · 20-05-2014 - 13:08

Hi,



If you don't use Odfconverter to do the transformation:



$docx->transformDocx('pages-word2-output-1-This-is-my-amazing-title.docx', 'example_text.pdf', null, array('odfconverter' => false));



The PDF will include the line numbering. We're going to check OdfConverter to find any issue but this is a quick solution if your documents don't use complex tables.



Regards.