Generate RTF file with phpword - laravel-5

I have some PHPWord code with Laravel 5 which generates a table with borders. The table displays correctly when created in a Word document, but there are no borders when saving to a .rtf file and the rows are generating infinetly.
The version of Phpword that I use is v0.12.1.

Related

How do I insert content after new page (automatically generated) or forced page break with dompdf using Twig?

I have created a PDF template that consists simply on a table with a header and multiple rows using Twig to create a PDF through dompdf library.
My problem is that I'm required to insert always another content, specifically a table, after each page with the purpose of having this another table always on the back page when doing duplex printing (in other words, at the end there should be an even number of pages, with the odd ones corresponding to the first table and the even ones corresponding to the inserted table). Do you know if there is a way to achieve this using dompfd or another PDF generation library compatible with Symfony/Twig?
Update: After thinking about other approaches to solve the problem, finally I discovered a library named php-pdftk, that allowed me to create the PDF that I wanted by separating each table into separated PDF's (with dompdf) and then merging both files with the function named "shuffle" (from pdftk), that inserts one page of the first PDF and then one page of the second PDF and so on.
Dompdf can handle the CSS property page-break-*:
.page_break {
page-break-after:always;
}
<h1>Page 1</h1>
...
...
<div class="page_break"></div>
<h1>Page 2</h1>
...
...

How can i fill data to PDF file on Laravel?

I am using Laravel and I have pdf file and i need dinamicaly fill there some fields data.
How can i do this without PDF View?
you can't edit a pdf file to fill his fields, what you can do is generate a pdf file and pass the content with the fields already filled, here is a library to do it: https://github.com/barryvdh/laravel-dompdf
I found this solution. I can do it by php-pdftk library library.
you cannot edit the pdf files directly , you got to create fields inside the pdf which can be read by the library. You can try this package strongbond/pdf-filler-laravel , i had a similar situation also wanted to add signature into the pdf which lead me to build this library.

Sphinx: include xlsx data into rst

What I want is to include an xlsx sheet (or rather the data of said file) into Sphinx documentation.
Is there any way to convert an xlsx sheet to restructuredText?
You do not need to convert it to rst. If you export your xlsx sheet to a comma separated file (csv) you can then use the csv-table directive.
The great thing is that you need to set up your table in your csv only once, and whenever you update your xlsx sheet, just export again to csv to the same location of where your table was before.
.. csv-table:: The contents of my xlsx sheet exported to mytable.csv
:widths: 15 40 20
:header: "Header 1", "Header 2", "Header 3"
:file: mytable.csv
That is all. Add as many widths and headers as you have columns in your file.
Note that in the documentation a security warning is given when using the :file: option. You can choose to copy paste the comma separated text into the document. However, if you update the table regularly I find it easiest to just export again to csv.
I have just released sphinxcontrib-excel, which embeds xlsx, xls and ods data (without style, font, charts) into your sphinx documentation. And you do not need to convert from xlsx to csv because the library does it for it.
Here is an example page where it was used to render excel data in readthedocs.org directly.

Not able to put text on image in table while creating PDF using XMLWorker

I am have html file and giving that to XMLWorkerHelper to parse it, so that it can generate PDF.
In Html. In table cell I can put text on image. but when I do
worker.parseXHtml(pdfWriter, document, isr);
it does not put text on image,
isr - it is ByteArrayInputStream of mockHttpServletResponse.
I have used all different kind of styling in html. but it is not working.
Please let me know how can I do this.

Searchable PDF Files (Image+Text PDF) validation

I am checking if a PDF document is searchable if I can get any text from every single page in a PDF.
But checking every page seems to take forever when I am trying to extract text from a PDF that contains more than 500~2000 pages.
Is it possible for a PDF to contain text for one page but not in the rest?
What I am trying to do here is that, if a first page of PDF contains text, then it is a searchable PDF else not..
Yes, it is very possible for a PDF to contain text on one page but not the rest. You could very well have a 500 page PDF that contains images on the first 499 pages, but contain text on the last page.
Unless you want to open the PDF file yourself and scan it for text/text operations, you will need to use an existing third-party PDF library that allows you to extract text from a PDF.
Also, see Ferruccio's response to a related question, which is to use the IFilter interface, specifically made for search indexing and text extraction.
Try this version of Searcharoo, which lets you search Word and PDF documents.

Resources