PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 11:17 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Oct 31, 2012 3:18 am 
Offline

Joined: Wed Oct 31, 2012 2:48 am
Posts: 2
In PDFSharp-MigraDocFoundation-1_32, for supporting Chinese chars, in the sample code project "Unicode", I changed the font name to a Chinese font name '微软雅黑'. After built and run, an assertion failed at PdfSharp.Pdf.IO\PdfWriter.cs line 231 in void Write(PdfName value) method, refer to the 3rd screenshot, and PdfSharp.Pdf.Internal\RawEncoding.cs file GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) method line 56, refer to the 2ed screenshot. And in the generated pdf file, the font name is not right, for each Chinese char, the hight byte is eaten off, refer to the 1st screenshot.

Looks like, the unicode(2 bytes) font name is NOT supported.


Attachments:
File comment: generated pdf file
33.png
33.png [ 40.22 KiB | Viewed 5127 times ]
File comment: PdfSharp.Pdf.Internal\RawEncoding.cs line 56
22.png
22.png [ 56.72 KiB | Viewed 5127 times ]
File comment: PdfSharp.Pdf.IO\PdfWriter.cs line 231
11.png
11.png [ 32.01 KiB | Viewed 5127 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group