System.IO.FileNotFoundException: Could not load file or assembly System.Windows.Forms

Stimulsoft Ultimate discussion
User avatar
Woodcutter
Posts: 56
Joined: Wed Mar 01, 2017 2:17 am

Re: System.IO.FileNotFoundException: Could not load file or assembly System.Windows.Forms

Post by Woodcutter »

The code:

StiFontCollection.AddFontFile("msyh");
StiFontCollection.AddFontFile("Arial Unicode MS");

Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport();
report.Load(@"TestMRZ7.mrz");

report.Render();
if (File.Exists(@"d:\aaa.pdf") == true) File.Delete(@"d:\aaa.pdf");
report.ExportDocument(Stimulsoft.Report.StiExportFormat.Pdf, @"d:\aaa.pdf");
Lech Kulikowski
Posts: 6301
Joined: Tue Mar 20, 2018 5:34 am

Re: System.IO.FileNotFoundException: Could not load file or assembly System.Windows.Forms

Post by Lech Kulikowski »

Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.
User avatar
Woodcutter
Posts: 56
Joined: Wed Mar 01, 2017 2:17 am

Re: System.IO.FileNotFoundException: Could not load file or assembly System.Windows.Forms

Post by Woodcutter »

Hey Lech

Project is in attached DE.zip


RGDS

Henry
Attachments
De.zip
(333.68 KiB) Downloaded 17 times
Lech Kulikowski
Posts: 6301
Joined: Tue Mar 20, 2018 5:34 am

Re: System.IO.FileNotFoundException: Could not load file or assembly System.Windows.Forms

Post by Lech Kulikowski »

Hello,

Please check the correct path to the font file.

Thank you.
Attachments
Screenshot 2024-04-24 101556.png
Screenshot 2024-04-24 101556.png (254.97 KiB) Viewed 106 times
User avatar
Woodcutter
Posts: 56
Joined: Wed Mar 01, 2017 2:17 am

Re: System.IO.FileNotFoundException: Could not load file or assembly System.Windows.Forms

Post by Woodcutter »

Hi Lech:

Base on your code ,In my computer,
set to "Arial Unicode MS"
StiFontCollection.AddFontFile("ARIALUNI.ttf");
Works OK.

set to "微软雅黑"
StiFontCollection.AddFontFile("msyh.ttc");
Works NG.

set to "楷体"
StiFontCollection.AddFontFile("simkai.ttf");
Works NG.

I have copy the font file to my EXE folder, but Chinese fonts still not good for display else "Arial Unicode MS".
There are test fonts download url as bellow
http://124.71.79.242/test/TestFont.zip
Attachments
微信图片_202404242129291.png
微信图片_202404242129291.png (102.73 KiB) Viewed 95 times
User avatar
Woodcutter
Posts: 56
Joined: Wed Mar 01, 2017 2:17 am

Re: System.IO.FileNotFoundException: Could not load file or assembly System.Windows.Forms

Post by Woodcutter »

There are 2 reports with problem font.

Thanks for your help.
Attachments
TestMRZ_simkai.mrz
(1.42 KiB) Downloaded 12 times
TestMRZ_MSYH.mrz
(1.41 KiB) Downloaded 12 times
Lech Kulikowski
Posts: 6301
Joined: Tue Mar 20, 2018 5:34 am

Re: System.IO.FileNotFoundException: Could not load file or assembly System.Windows.Forms

Post by Lech Kulikowski »

Hello,

Please send your fonts also for analysis.

Thank you.
Lech Kulikowski
Posts: 6301
Joined: Tue Mar 20, 2018 5:34 am

Re: System.IO.FileNotFoundException: Could not load file or assembly System.Windows.Forms

Post by Lech Kulikowski »

Hello,

We need some additional time to investigate the issue, we will let you know about the result.

Thank you.
Lech Kulikowski
Posts: 6301
Joined: Tue Mar 20, 2018 5:34 am

Re: System.IO.FileNotFoundException: Could not load file or assembly System.Windows.Forms

Post by Lech Kulikowski »

Hello,

Please add alias name of the fonts:
StiFontCollection.AddFontFile("simkai.ttf", "楷体");

Thank you.
Post Reply