-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Corrupt XLSX file when drawing image #1022
Comments
just a question, are you missing |
I tried "drawing->setHeight(36);" |
Try using xls template then output xlsx file |
I tried xls template then facing this error "You tried to set a sheet active by the out of bounds index: 0. The actual number of sheets is 0." |
You must use Class Xls |
I could download but the output xlsx looks broken... |
Did you open template xlsx file and save as xls file or just change the extension ? |
I opened template xlsx file and saved as xls file... |
Try this header |
"$writer->save($tmp_path);" saves same as the output xlsx as temporary file in the server before downloading. I checked the file and tried to open it. Also tried header |
I have encountered the same issue but it is only present when loading a template. If I create a sheet using the "new Spreadsheet()" syntax it works as expected. After additional testing if I created my template entirely in PHP using the library it works correctly. The error only happens if I build a template in Excel (2019) and then use that file. |
I have same issue too. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This works for me, thank you |
FIxed by #1462. |
This is:
I wanted to download xlsx file in which added image file with phpspreadsheet.
Then I am facing issue of excel file broken due to "$drawing" as below source code.
What is the expected behavior?
No error when open the excel file.
What is the current behavior?
When opened the xlsx file, it always asked if fix to see.
What are the steps to reproduce?
Kindly try below code...
// add code that show the issue here...
use PhpOffice\PhpSpreadsheet\Settings;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx as XlsxReader;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx as XlsxWriter;
use PhpOffice\PhpSpreadsheet\Writer\CSV as CSVWriter;
class TestsController extends AppController{
}
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet 1.7
PHP 7.0.3
cakephp3.6
The text was updated successfully, but these errors were encountered: