Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Dec 18, 2013 1:45 pm

We are currently evaluating your product.

One major requirement for us is to able to insert RTF into PDF documents generated dynamically.

I tested the LoadFromRTF method and seems to do the job.

The only thing is that we need to be able to specify the position on the page (X, Y) to insert the RTF.

Is there any way to do this ?

drinkwater
 
Posts: 3
Joined: Wed Dec 18, 2013 1:25 pm

Thu Dec 19, 2013 8:08 am

Hello,

Thanks for your inquiry.
Sorry that at present our product doesn't support it. And we have added the new feature to our schedule, once it is added, we will inform you immediately.
If there are any questions, welcome to get it back to us.
Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Dec 19, 2013 12:28 pm

Hello,

Also, we would need a way to insert multiple rtf's on the same page (at different X,Y positions of course).

drinkwater
 
Posts: 3
Joined: Wed Dec 18, 2013 1:25 pm

Thu Dec 19, 2013 3:49 pm

Hello,

Also, would it be possible to have a timeline for these new features ?
We are on a very tight schedule and we really need to find a working solution.

Thank-you

drinkwater
 
Posts: 3
Joined: Wed Dec 18, 2013 1:25 pm

Fri Dec 20, 2013 1:39 am

Hello,

Sorry that we couldn't give you an accurate time, so sorry for inconvenience. Once it is added, we will inform you immediately.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Fri Dec 20, 2013 6:30 am

Hello,

We have added an overloads method of LoadFromRTF method: LoadFromRTF(string rtf, float width, float height, bool IsSplitLine, PointF point), it would be supported in the next hotfix, once it is released, we will inform you immediately.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Dec 31, 2013 8:39 am

Hello,

The new hotfix of Spire.Pdf has been released, please download Spire.Pdf2.9.13 from http://www.e-iceblue.com/Download/downl ... t-now.html and test the following new method.
Code: Select all
PdfDocument pdfdoc = new PdfDocument();
pdfdoc.LoadFromFile(@"..\..\result.pdf");
PdfPageBase page = pdfdoc.Pages[0];
page.LoadFromRTF(string rtf, float width, float height, bool IsSplitLine, PointF point);


If there are any questions, welcome to get it back to us.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Jan 06, 2014 9:15 am

Hello,

Have you tried the method? Does it fulfill your needs? Could you please give us some feedback if convenience?

If there are any questions, welcome to get it back to us.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Feb 09, 2021 10:12 am

Hi, iam eveluating Spire PDF and iam very happy about the first results to create complex PDF's very simple and fast.
i noticed this thread, because it is on goal feature we need to integrate Spire.PDF in our main Product (42software.de)
i tested it, it works somehow - but the Fonts are ignored, so i think it was just a temporarily fraft implementation on the fly.
the compiler warning also underline this: 'This method may be removed in the future,not support rtf.
my question, is there any goal in future for full Richtext implementation?
is there any other possibility for rendering Richtext through another method and then positioning a metafile render?

RDreifuss
 
Posts: 2
Joined: Mon Feb 08, 2021 10:32 am

Wed Feb 10, 2021 7:02 am

Hello

Thanks for your inquiry.
Yes, the method “LoadFromRTF” is obsolete and will be removed in future versions of Spire.PDF. To render Richtext on PDF, you can use our Spire.Doc (the latest version is Spire.Doc Pack(hot fix) Version:9.2.0) to convert RTF file/string to Word file, and then convert it to PDF. Below is the corresponding code for your reference.
Code: Select all
            Spire.Doc.Document doc = new Spire.Doc.Document();

            //Method1: Load an rtf file.
            doc.LoadFromFile("test.rtf", FileFormat.Rtf);

            ////Method2: Append the rtf string to the document
            //string rtfStirng = "Your rtf string";
            //doc.AddSection().AddParagraph().AppendRTF(rtfString);

            doc.SaveToFile("test.pdf", FileFormat.PDF);


If this doesn’t meet your needs well, please provide your RTF file/string along with your desired PDF file. Then we will investigate further.

Besides, if you want to use both Spire.Doc and Spire.PDF in the same project, please directly download Spire.Office (the latest version is Spire.Office Platinum(Hotfix) Version:6.2.1) to avoid dll version incompatibility.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed Feb 10, 2021 2:15 pm

i tried to switch to Spire.Doc.

Can i set an output Rectangle for the RTF Fragment String?
How do i get any measures / dimensions from the inserted RTF-Field?

RDreifuss
 
Posts: 2
Joined: Mon Feb 08, 2021 10:32 am

Thu Feb 11, 2021 9:45 am

Hello,

Thanks for your response.
For your first question, when using our Spire.Doc, you can create a textbox and then add the RTF text to the textbox. Below is the corresponding code for your reference.
Code: Select all
            Document doc = new Document();

            Section section = doc.AddSection();
            Paragraph paragraph = section.AddParagraph();
            TextBox tb = paragraph.AppendTextBox(220, 220);

            //Set the position of the textbox
            tb.Format.HorizontalOrigin = HorizontalOrigin.Page;
            tb.Format.HorizontalPosition = 50;
            tb.Format.VerticalOrigin = VerticalOrigin.Page;
            tb.Format.VerticalPosition = 50;
            tb.Body.AddParagraph().AppendRTF("your rtf text");
            //set shape fit to text
            //tb.Format.IsFitShapeToText = true;

            doc.SaveToFile("result.pdf", FileFormat.PDF);


For your second question, do you mean to get the location of the rtf text in the PDF document? If so, our Spire.PDF supports finding the text and getting its location information, like the following code.
Code: Select all
            PdfDocument pdf = new PdfDocument();
            pdf.LoadFromFile(@"input.pdf");
            PdfTextFind[] result = null;
            foreach (PdfPageBase page in pdf.Pages)
            {
                //Find text
                result = page.FindText("keyword", TextFindParameter.None).Finds;
                foreach (PdfTextFind find in result)
                {
                    //Get its bouds
                    RectangleF bounds = find.Bounds;
                }
            }


If there are any misunderstandings, please provide more detailed information to help us investigate further, such as your RTF text and your desired output.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Feb 22, 2021 1:51 am

Hello,

Has your issue been resolved? Any feedback will be greatly appreciated.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.PDF