Closed stefanstranger closed 9 months ago
Hi,
I need to update PSWriteOffice to newest library version, because we already support those layouts in newest one
var pargraphWithImage = paragraph.AddImage(file, 100, 100, WrapTextImage.InLineWithText, "Przemek and Kulek on an image");
In PowerShell it will be like
$pargraphWithImage = $paragraph.AddImage(file, 100, 100, [WrapTextImage]::InLineWithText, "Przemek and Kulek on an image");
Probably the WrapTextImage will need a full type or using to work. New version also allows switching between TextWrappings
So as soon as the image is added you can also change it on the fly. I'm neglegtic powershell version a bit, but OfficeIMO alone is hard to manage ;)
Hi Przemysław,
Thanks for your fast response. Do I understand I need to wait for you to update the PowerShell module to use the latest library?
When I try to do it using the existing library I get the following error:
$Paragraph.Image.WrapText = 'BehindText'
SetValueInvocationException: Exception setting "WrapText": "This needs to be implemented properly!"
Regards, Stefan Stranger
Ye, I'll try to release it tonight. I've not updated the library for a bit. Also keep in mind that when you switch between different Wraps (Inline vs Anchor) it looses certain prroperties. Inline has minimal set properties because it's kind of bound to paragraph, and the rest is basically anchored, so you would need to play with positioning after doing changes like that.
I've released new version - you can try it out.
@PrzemyslawKlys
I tried to update the PSWriteOffice module via the PowerShell gallery but got this error message: Install-Package: Authenticode issuer 'CN=Przemysław Kłys EVOTEC, O=Przemysław Kłys EVOTEC, L=Mikołów, C=PL' of the new module 'PSWriteOffice' with version '0.2.0' from root certificate authority 'CN=DigiCert Trusted Root G4, OU=www.digicert.com, O=DigiCert Inc, C=US' is not matching with the authenticode issuer 'CN=Przemysław Kłys EVOTEC, O=Przemysław Kłys EVOTEC, L=Katowice, S=Śląskie, C=PL' of the previously-installed module 'PSWriteOffice' with version '0.1.0' from root certificate authority 'CN=DigiCert Assured ID Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US'. If you still want to install or update, use -SkipPublisherCheck parameter.
Install-Module PSWriteOffice -Force -Verbose -SkipPublisherCheck
I changed certificate some time ago, as my last one expired and there's no other way around it.
Ok I did the use the -skippublishercheck option to resolve this.
Should I ask internally on how above error can be fixed?
Stefan Stranger [MSFT]
The error above is not really an error. Once you install module with certain certificate it's there to protect you a bit from changes or dropping non-signed versions. However when my 3 year certificate expired and it changes - that is the cert warning you get. I wish it was easier, but you can either delete the old versions and do install-module without skippublishercheck, or use skippublishercheck. Otherwise that's the warning you get.
In theory maybe if the whole issuer/subject name would be the same it could work, but DigiCert gave me new data so it's a mismatch.
I'm using the PowerShell Module PSWriteOffice for Word document creation and I'm trying to insert an image using the following code:
But I need to apply the following layout configuration.
How can this be done programmatically?
Regards, Stefan Stranger