PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 6:32 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: Thu Jul 11, 2019 4:28 pm 
Offline

Joined: Thu Jul 11, 2019 4:21 pm
Posts: 1
Hello All,

Can anyone suggest me how to change the font properties of Text Annotation content since i have facing issue of data in Japanese is not supported in PdfTextAnnotation.

Code:
[code]var CNNAnnot = new PdfTextAnnotation();
                                            CNNAnnot.Flags = PdfAnnotationFlags.Locked;
                                            CNNAnnot.Title = "Connector Details";
                                            //CNNAnnot.Elements


                                            if (newConnector == true)
                                            {
                                                communicater = new synchronizer(newConnectorFinder);
                                                Invoke(communicater);
                                                CNNAnnot.Contents = "Connector Number : " + cNumber + " (New)" + Environment.NewLine;
                                            }
                                            else
                                                CNNAnnot.Contents = "Connector Number : " + cNumber + Environment.NewLine;
                                            CNNAnnot.Contents += Environment.NewLine + "SC Name : " + SCName + Environment.NewLine;
                                            CNNAnnot.Contents += Environment.NewLine + "SM Name : " + SMName + Environment.NewLine;
                                            if (CNNRemarks != "-")
                                                CNNAnnot.Contents += Environment.NewLine + "Remarks : " + CNNRemarks + Environment.NewLine;
                                            if (CNNExcessData != 0)
                                            {
                                                CNNAnnot.Contents += Environment.NewLine + "===============" + Environment.NewLine;
                                                CNNAnnot.Contents += "Applicability" + Environment.NewLine + "===============" + Environment.NewLine;
                                                for (int iteration = 0; iteration <= CNNSheetCountColumn - CNNExcessData; iteration++)
                                                {
                                                    CNNAnnot.Contents += CNNtitleContent[iteration] + " : " + CNNNumberContent[iteration] + Environment.NewLine;
                                                }
                                            }
                                            if (newConnector == true)
                                                CNNAnnot.Color = XColors.Gold;
                                            else
                                                CNNAnnot.Color = XColors.Green;
                                            CNNAnnot.Icon = PdfTextAnnotationIcon.Insert;
                                            option.Annotations.Add(CNNAnnot);
                                            var CNNrect = new XRect();
                                            xCoOrdinate = textStringBox.X;
                                            yCoOrdinate = textStringBox.Y;
                                            textWidth = textStringBox.Width;
                                            textHeight = textStringBox.Height;

                                            ConnectorLocationInSc.Add(cNumber, Math.Floor(xCoOrdinate).ToString() + ":" + Math.Floor(yCoOrdinate).ToString());

                                            CNNrect = gfx.Transformer.WorldToDefaultPage(new XRect(new XPoint(xCoOrdinate, yCoOrdinate), new XSize(0, 0)));
                                            CNNAnnot.Rectangle = new PdfRectangle(CNNrect); [/code]



Here SM name is fetched from excel and it is added in PDF as annotation but SM name in japanese is not displayed correctly.

could you please anyone suggest be how to proceed with this


Attachments:
File comment: Image after Pdf Generation
Capture.PNG
Capture.PNG [ 4.94 KiB | Viewed 27350 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: Bing [Bot] and 43 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