Merge cells does not work while creating pdf using PHPExcel - phpexcel

I am trying to create a PDF document using PHPexcel and mPDF as rendering engine.It generates an error "This PDF document might not be viewed correctly" when using the following code to merge cells.
$objPHPExcel->getActiveSheet()->mergeCells('A1:A3');
Has anybody experienced this error?
Simmy

Quick and Dirty fix;
Change line 1236 of PHPExcel/Writer/HTML.php, which reads:
$cssClass .= ' style' . $pSheet->getCell($endCellCoord)->getXfIndex();
to
if (!$this->_useInlineCss) {
$cssClass .= ' style' . $pSheet->getCell($endCellCoord)->getXfIndex();
}

Related

getting data from pdf file using ElasticSearch / Symfony

actually i'm using Symfony and i have integrated ElasticSearch ,
I want to extract data from Pdf file (name,age,adress)/ or text file in order to get a form filled with data how to do it ?
Ps: I have configured elastic.yml i have added all the indexs , and when i have have visited 127.0.0.1:9200 i got my object successfully (json format) all i want is how to read from pdf file and retrieve all data
You have to use pdf parsing library like https://pdfparser.org/documentation
$parser = new \Smalot\PdfParser\Parser();
$pdf = $parser->parseFile('document.pdf');
$text = $pdf->getText();
echo $text;

R Error: unexpected ',' in "write(txt2, file = ("C:/Users/User/Documents/html","

I received this error when exporting html into text. I dont really understand what cause this. Please help me with it. Thank you in advanced
Error: unexpected ',' in " write(txt2, file = ("C:/Users/User/Documents/html","
to export converted html in text.
Below is my code in R:
write(txt2, file = ("C:/Users/User/Documents/html", txt2.txt))
the objective is to convert html webpage into text and export it into working directory using R.
The last line of code is causing this error which i don't know why.

Create and Write PDF Webdev

I want to create and write in file's PDF.
my code :
fCrée("C:\Mes Sites\COBRA_22\Courrier\test.pdf")
fOuvre("C:\Mes Sites\COBRA_22\Courrier\test.pdf",foAjout)
fSauveTexte("C:\Mes Sites\COBRA_22\Courrier\test.pdf","ok")
But this code does'nt work !
Thank for your help :)
This functions are not for create a PDF, you must look into this documentation for create a PDF from a report with windev.
As sayed Bidjes answer the easiest way to create pdf is to use report,
you'll have to create fields into your report an link them to a database or global variables.
here's an example (with global variables) :
Report :
English Version :
gsHeader = "This is a title !"
gsBody = "This is a simple text."
iPreview(iPDF, "PATH_AND_NAME.pdf")
iPrintReport(REPORT_test)
French version :
gsTitre = "C'est un titre !"
gsContenu = "C'est un simple texte."
iAperçu(iPDF, "CHEMIN_ET_NOM.pdf")
iImprimeEtat(ETAT_test)
Result :

Generate chart as an html file with custom name

I like to create bunch of googleVis charts and one I create the charts, I like to create a different html files with custom names so that I can reference them in my front page with divs.
For example, I am doing this:
x <- gvisTable(mtcars)
writeLines(x, "cars.html")
I get this error:
Error in writeLines(x, "cars.html") : invalid 'text' argument
Ideas how would I address this problem?
I got the answer, I can simply to this and write it to any html file I like:
cat(x$html$chart, file="tmp.html")

phpexcel fit to selection

I generate an excel file using the great PHPExcel library. At this moment I need to show all the columns into a single page. You know the feeling when you have to scroll left and right up and down to see all the data. Basically I have 33 columns and I need to fit them on any display
I don't know if is my setup or where is the problem, but I can't make it work. This is the code I'm using
$objPHPExcel->getActiveSheet()->getPageSetup()->setFitToPage(true);
$objPHPExcel->getActiveSheet()->getPageSetup()->setFitToHeight(0);
$objPHPExcel->getActiveSheet()->getPageSetup()->setFitToWidth(1);
On MS Excel I select all thw colums then I choose View-> Zoom, then select Fit Selection. How can I do that programatically when excel file is generated with PHPExcel.
i hope i don't understand you wrong, here it goes:
phpExcel has an method called setZoomScalezoom(), however this does not auto fill the whole screen:
example:
$excel = new PHPExcel();
$sheet = $excel->getActiveSheet();
$sheet->getSheetView()->setZoomScale(300);
$writer = new PHPExcel_Writer_Excel5($excel);
$writer->save('test.xls');
got my information from:
source: http://typo3.org/extension-manuals/phpexcel_library/1.7.4/view/5/4/
Setting worksheet zoom level To set a worksheet’s zoom level, the
following code can be used:
$objPHPExcel->getActiveSheet()->getSheetView()->setZoomScale(75);
Note that zoom level should be in range 10 – 400.

Resources