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

Better support for images #7

Open
6 of 11 tasks
PrzemyslawKlys opened this issue Dec 31, 2021 · 6 comments
Open
6 of 11 tasks

Better support for images #7

PrzemyslawKlys opened this issue Dec 31, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@PrzemyslawKlys
Copy link
Member

PrzemyslawKlys commented Dec 31, 2021

I am not sure if those are even possible or word does this natively, but I'll add it here

  • Corrections
  • Transparency Effects
  • Artistic Effects

Docs: http://officeopenxml.com/drwPic-ImageData.php

@PrzemyslawKlys PrzemyslawKlys changed the title Add Images Better support for images Oct 14, 2022
@shane-droid
Copy link

shane-droid commented Oct 22, 2022

@PrzemyslawKlys, I am having trouble adding jpg or png to header. The word doc says image can not be displayed.
Any ideas
??

@PrzemyslawKlys
Copy link
Member Author

Please open separate issues for "problems". But from what I see there's no AddImage() for Headers/Footers so not sure how you add it? :-)

image

I guess we need to add it.

@PrzemyslawKlys
Copy link
Member Author

Ah, i see how you did it:

                var header = document.Header.Default;
                header.AddParagraph("This is header");
                //header.AddImage(filePathImage, 100, 100);
                header.AddParagraph().AddImage(filePathImage, 100, 100);

And yes it doesn't work. I'll take a look. Probably image references is done differently.

@shane-droid
Copy link

@PrzemyslawKlys: correct, that is how i did it. I appologize for not adding an issue, I felt I was using the package incorrectly.

@tmheath
Copy link
Contributor

tmheath commented Jan 2, 2024

Apparently pre-2021 release word does not support transparency for images. Do you think it might be a good idea to script transparency onto the image file itself using something like ImageMagick (effectively just manipulating the opacity channel or inserting it if it doesn't exist)? That might be just entirely outside the scope of the library.

@PrzemyslawKlys
Copy link
Member Author

I have a project for PowerShell that uses SixLabors which is already part of OfficeIMO to do image manipulations:

Part of it is image manipulation:

Probably ImagePlayground could be published as separate nuget and one could use it's features which automate some of those SixLabors things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants