EvotecIT / PSWritePDF

PowerShell Module to create, edit, split, merge PDF files on Windows / Linux and MacOS
GNU Affero General Public License v3.0
195 stars 21 forks source link

Register-PDFFont failed to add kaiu.ttf #37

Closed Matt79080701 closed 2 years ago

Matt79080701 commented 2 years ago

I used New version 0.0.18 add kaiu.ttf. but I’not working,but used to old version 0.0.17 add completed and can output pdf.

maybe is encoding something wrong. my windows language is chinese-traditional

I want to used 0.0.18 New-PDFImage function. can I just add this Function to 0.0.17?

PrzemyslawKlys commented 2 years ago

What is the error message? Adding function between versions is possible but you would need to add relevant code (not just the missing function).

Matt79080701 commented 2 years ago

run 0.0.18 version to chinese-traditional windows language If just add image will show New-InternalPDF - Terminating Error "1" ..".ctor"..message image

If Register-PDFFont will show Font Registration failed. Error: "Create Font" ".ctor" .."3".. message image

Can you help me just add the function "New-PDFImage" and where to find what's missing relevant code. How to add to 0.0.17. Thank you

PrzemyslawKlys commented 2 years ago

You're using it wrong.

New-PDF -FilePath "$PSScriptRoot\Example01_Simple3-2.pdf" -PDFContent {
    Register-PDFFont -FontName 'Verdana' -FontPath 'C:\Windows\fonts\verdana.ttf' -Encoding IDENTITY_H -Cached -Default
    New-PDFText -Text 'Hello ', 'Привет !'
} -Show

The Register-PDFFont has to be inside the New-PDF.

Matt79080701 commented 2 years ago

I did as you said. But Register-PDFFont Error to CreateFont image

Matt79080701 commented 2 years ago

same command line used to 0.0.17 can out put pdf file. and does not show errors image

PrzemyslawKlys commented 2 years ago

Please send the font so I can check it

Matt79080701 commented 2 years ago

This is Fonts info. But I dont know how to download. https://docs.microsoft.com/en-us/typography/font-list/dfkai-sb

Matt79080701 commented 2 years ago

My system environment image

Matt79080701 commented 2 years ago

Hi,there

I debugged myself for a while but I haven't found out the reason, is there any news that I can provide, God bless you

PrzemyslawKlys commented 2 years ago

It's my fault. Something must have changed between versions. I think I fixed it. I will release new version

PrzemyslawKlys commented 2 years ago

Released new version

Matt79080701 commented 2 years ago

Hi,Matt again

Register-PDFFont is fixed in new version. But can not output pdf file with 0.0.18 & 0.0.19

image

PrzemyslawKlys commented 2 years ago

Open a new issue, and please make sure to translate the error message because with those errors - I can't read them.