Error on PHP Excel 1.8 Call to undefined function getNameFromNumber() - php

i just wanted to import with PHP Excel 1.8 class and then i got this error Fatal error: Call to undefined function getNameFromNumber() in includes/PHPExcel-1.8/Classes/PHPExcel/Writer/HTML.php on line 1617.
Can someone image what here the problem or better what i can do?
Thanks.
Olaf

I'd download a fresh source from https://github.com/PHPOffice/PHPExcel/releases/tag/1.8.1
or the latest files from github # https://github.com/PHPOffice/PHPExcel
as neither of those include that line/function you reference.

Related

Class 'PHPExcel_CachedObjectStorage_CacheBase' not found in PHP

I got Error while I was transferred my website to the new server.
I have import Data in Excel file using Php PHPExcel library but I have got the error.
Error Message:
Fatal error: Class
'PHPExcel_CachedObjectStorage_CacheBase' not found in
/home/ndjnckfu/accounting.isplace.in/api/PHPExcel/Classes/PHPExcel/CachedObjectStorage/Memory.php
on line 28
Please send your thoughts below a comment.
Thank You.

PHP: Merge PDFs without composer?

I am trying to merge PDF documents with PHP and have searched a lot and tried several solutions. What seems to be the most common is using the FPDI library and then a small class like PDF-Merger.
But the problem is that that library is dependent of other libraries and those libraries of others and so on. And the installation examples is mostly how to install with composer. But I wanna be able to merge pdf's for a site that's not using composer. And it seems to be really hard to achieve that.
Due to the manual, the only thing to do if I don't wanna use the composer is writing this to your code as the installation of the library:
require_once('path/to/src/autoload.php');
Of course, with the correct path. But no, that didn't work for me. Couldn't find the fpdi class. And if you look at the manual again, you see this warning:
Don't forget to install FPDF, TCPDF or tFPDF before!
So I manually downloaded those three libraries and also those were hard to install without composer. And are still stucked in this mess. I have made some success by changing in the PDFMerger.php file from use fpdi\FPDI; to \setasign\Fpdi\Fpdi. So now is the Fpdi class found. But still get errors.
Let me show you the current situation. Here is my current code:
<?php
require_once get_stylesheet_directory().'/classes/fpdf/fpdf.php';
require_once get_stylesheet_directory().'/classes/tfpdf/tfpdf.php';
require_once get_stylesheet_directory().'/classes/tcpdf/src/Output.php';
require_once get_stylesheet_directory().'/classes/tcpdf/src/MetaInfo.php';
require_once get_stylesheet_directory().'/classes/tcpdf/src/ClassObjects.php';
require_once get_stylesheet_directory().'/classes/tcpdf/src/Tcpdf.php';
require_once get_stylesheet_directory().'/classes/FPDI/src/autoload.php';
require_once get_stylesheet_directory().'/classes/FPDI/src/Fpdi.php';
require_once get_stylesheet_directory().'/classes/PDFMerger/PDFMerger.php';
$pdf = new \Clegginabox\PDFMerger\PDFMerger;
$pdf->addPDF('path/to/file1.pdf', 'all', 'P');
$pdf->addPDF('path/to/file2.pdf', 'all', 'P');
$pdf->merge();
?>
And here are the error messages in the browser:
Notice: Undefined index: w in
/home/public_html/wp-content/themes/my-theme/classes/PDFMerger/PDFMerger.php
on line 85
Notice: Undefined index: h in
/home/public_html/wp-content/themes/my-theme/classes/PDFMerger/PDFMerger.php
on line 85
Notice: Undefined index: w in
/home/public_html/wp-content/themes/my-theme/classes/PDFMerger/PDFMerger.php
on line 85
Notice: Undefined index: h in
/home/public_html/wp-content/themes/my-theme/classes/PDFMerger/PDFMerger.php
on line 85
Fatal error: Uncaught Exception: FPDF error: Some data has already
been output, can't send PDF file in
/home/public_html/wp-content/themes/my-theme/classes/fpdf/fpdf.php:271
Stack trace: #0
/home/public_html/wp-content/themes/my-theme/classes/fpdf/fpdf.php(1063):
FPDF->Error('Some data has a...') #1
/home/public_html/wp-content/themes/my-theme/classes/fpdf/fpdf.php(999):
FPDF->_checkoutput() #2
/home/public_html/wp-content/themes/my-theme/classes/PDFMerger/PDFMerger.php(107): FPDF->Output('I', 'newfile.pdf') #3
/home/public_html/wp-content/themes/my-theme/functions.php(269):
Clegginabox\PDFMerger\PDFMerger->merge() #4
/home/public_html/wp-includes/class-wp-hook.php(286):
cdon_woocommerce_loaded('') #5
/home/public_html/wp-includes/cla
in
/home/public_html/wp-content/themes/my-theme/classes/fpdf/fpdf.php
on line 271
And you can see the PDFMerger.php here and line 85 is this:
$fpdi->AddPage($fileorientation, array($size['w'], $size['h']));
I mean, I think it's a little exaggerated to have all these dependencies to just merge pdfs. Is this really needed? And if so, what is wrong with my installation?
You don't need composer to use PDFMerger.
Just clone the original repository from https://github.com/myokyawhtun/PDFMerger and move PDFMerge.php and the tcpdf directory into your project.
Then you can do the following:
include 'PDFMerger.php';
$pdf = new \PDFMerger\PDFMerger;
The mentioned merger class is outdated and relies on legacy versions. Just use the up to date native FPDI code which you can find here. This demo shows you how you can use FPDI to concatenate several PDF documents.
You should also notice the or in the info text of the installation instructions:
Don't forget to install FPDF, TCPDF or tFPDF before!
For sure you only need to install one of those classes. If you want to concatenated PDF pages, you should go with FPDF.

Fatal error: Call to undefined function printer_list()

So Im busy with this project that involves printing. I found a class online to do so. But when I try to test it, I get the following error:
Fatal error: Call to undefined function printer_list() in /Applications/XAMPP/xamppfiles/htdocs/barcode/Sample.php on line 9
And I know that I probably should install an extention, but how which one and how to do so? I use Xampp on OSX Yosemite.
The printer extension working only on Windows
printer_list() id deprecate in new php

How do I fix the error of call to undefined function for add_settings_field()?

I followed exactly this tutorial and I got this error:
Fatal error: Call to undefined function add_settings_field() in
/home/content/41/11334041/html/test/wp-content/themes/mothereffintheme/functions.php
on line 47
I'm new to working with the Wordpress API and I don't have any idea to how to fix it.
I saved it in my FTP program instead of the the theme editor. It worked!
Are you sure you loaded WordPress? add_settings_field() is a WordPress function rather than a default PHP function, if it's undefined it would indicate that the WordPress core hasn't been loaded. A bit of code might help.
http://codex.wordpress.org/Function_Reference/add_settings_field

500 error writing to PDF using Zend

I have Zend working properly, and it will open a PDF, and save it, but when I try to actually use drawText to write some text over the PDF, I get this:
PHP Fatal error: Call to undefined method Zend_Pdf::drawText() in /home/whatever/test.php
I don't understand why it won't work, thoughts?

Categories