Skip to content
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

Corrupted Xlsx when Drawing inserted to page with printing settings #1561

Closed
1 task done
konovalovk opened this issue Jun 30, 2020 · 3 comments
Closed
1 task done

Comments

@konovalovk
Copy link

konovalovk commented Jun 30, 2020

This is:

  • a bug report

What is the expected behavior?

Xlsx file should be opened with no issue.

What is the current behavior?

Corrupted Xlsx when Drawing inserted to page with printing settings.

What are the steps to reproduce?

Create empty Xlsx file, define printing settings like the screenshot.

The code below behaves different:

  • if there are no printing settings - file is ok, image inserted successfully
  • if there is some printing setting like 1-page-width - MS office opens file with warning

изображение

	$book = PhpOffice\PhpSpreadsheet\IOFactory::load('1.xlsx');
	$image = new PhpOffice\PhpSpreadsheet\Worksheet\Drawing();
	$image->setPath('1.jpg')->setCoordinates('F10')->setHeight(50);
	$image->setWorksheet($book->getActiveSheet());
	$writer = new PhpOffice\PhpSpreadsheet\Writer\Xlsx($book);
	$writer->save('2.xlsx');

Which versions of PhpSpreadsheet and PHP are affected?

1.14, 1.13

@konovalovk
Copy link
Author

The suggestion from @Aristotel2003 to add any symbol to tail of $rId for printer settings works #1462 (comment)

@stale
Copy link

stale bot commented Aug 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Aug 29, 2020
@stale stale bot closed this as completed Sep 5, 2020
@konovalovk
Copy link
Author

+1.15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants