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

insert image #927

Closed
dimaregabriele opened this issue Mar 12, 2019 · 7 comments
Closed

insert image #927

dimaregabriele opened this issue Mar 12, 2019 · 7 comments
Labels

Comments

@dimaregabriele
Copy link

How do I insert an image into the xls file? the image is present on the server. format png.

@AndreyNazarchuk
Copy link

AndreyNazarchuk commented Apr 4, 2019

$sheeti = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing();
$sheeti->setName('name');
$sheeti->setDescription('description');
$sheeti->setPath('/filename.png');
$sheeti->setHeight(90);
$sheeti->setCoordinates("G14");
$sheeti->setOffsetX(20);
$sheeti->setOffsetY(5);
$sheeti->setWorksheet($sheet);

@leadstar116
Copy link

I can insert image into xls format file.
But when I write it into pdf using MPDF library, image is broken.
How can I fix this?

@danielpolifabro
Copy link

leadstar116, Its happing with me too.
I can save a totally formatted xlsx file (including images in header and footer)
but when I use Mpdf library to convert to PDF these resources dont apper.

@leadstar116
Copy link

Hi, Daniel

Did you try to set absolute path for image?
It works for me.
Give full path of image.
It will appear on pdf but with broken style, I guess.

@dimaregabriele
Copy link
Author

I found that if I open the excel file, I insert the image, and save the file with another name there are no problems, otherwise it goes wrong.

@githubjeka
Copy link

Probably cause is #877 (comment)

@stale
Copy link

stale bot commented Sep 24, 2019

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.

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

No branches or pull requests

5 participants