We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can I save content from richTextBox as pdf?

Thread ID:

Created:

Updated:

Platform:

Replies:

131463 Jul 11,2017 12:15 PM UTC Aug 7,2017 09:27 AM UTC Windows Forms 10
loading
Tags: PDF
Vhalaky
Asked On July 11, 2017 12:15 PM UTC

Hi, can I save (or convert) formatted (colors, font, tables, etc) content from richTextBox as pdf?

Like as rtf saving:

richTextBox1.SaveFile(saveFile1.FileName, RichTextBoxStreamType.PlainText);

Sethumanikkam Yogendran [Syncfusion]
Replied On July 12, 2017 09:29 AM UTC

Hi Mate,

Thank you for contacting Syncfusion support.

We have prepared a sample to meet your requirement and in this sample, we have done the following.

     1. Selected all text from RichTextBox as RTF.
     2. Loaded RTF as Stream using Essential DocIO.
     3. Convert loaded Word document into PDF using Essential DocIO and Essential PDF.

Please find the below sample which illustrates the same. Please let us know if it helps you.
Sample link

If we misunderstood any of your requirement, then kindly provide us your sample or modified above sample and screenshot/output Word document of the expected result along with input which will be helpful to provide you the appropriate solution.

Please let us know if you have any other questions.

Regards,
Sethumanikkam.Y


Vhalaky
Replied On July 20, 2017 11:25 AM UTC

Thank you, it works. But proper formatting of rtf seems hard, html much easier. So I think I will use WebBrowser. Can I save content of WebBrowser to pdf?


Prakash Viswanathan [Syncfusion]
Replied On July 21, 2017 01:45 PM UTC

Hi Mate, 

Yes, we can save the web browser content to PDF using our WebKit HTML converter, but we need to provide the input HTML/URL as input to convert a webpage content to PDF.  

Please refer below links for more information of our WebKit HTML converter, 

You can download latest WebKit installer from below link,  
  
After installing WebKit HTML converter, you can get the required assemblies, QtBinaries and samples from WebKit installed location.  
Example: $Systemdrive\Program Files (x86)\Syncfusion\WebKitHTMLConverter\xx.x.x.xx\  

Regards, 
Prakash V 


Vhalaky
Replied On July 23, 2017 08:45 AM UTC

Thank you!


Vhalaky
Replied On August 3, 2017 08:56 AM UTC

Hi, it works with my sample project but does not work with my real project.

Assembly versions are identical in sample and real project: 15.1460.0.33

As a trial I copied QtBinaries folder from sample to real project but I get this error message:

---------------------------
07f238b5-e00d-4d44-8bd3-5e76439e330b
---------------------------
This application failed to start because it could not find or load the Qt platform plugin "windows".

Reinstalling the application may fix this problem.

What could be the problem?


Prakash Viswanathan [Syncfusion]
Replied On August 3, 2017 12:13 PM UTC

Hi Mate, 
 
1. This error may occurs due to the version mismatch of assemblies and QtBinaries used for HTML to PDF conversion. We usually do changes in assemblies and QtBinaries for every release. So, please make sure you are using the assemblies and QtBinaries from the same WebKit Installer. You can get assemblies and QtBinaries for a specific version by installing the WebKit HTML converter. 
2. This error may occurs if any of the Qt assemblies or subfolder is missing in the QtBinaries folder. So, please make sure all the Qt assemblies are present in the QtBinaries folder, please check the list assemblies with QtBinaries folder from WebKit HTML converter installed location. 
 
You can get latest WebKit installer from below link,   
   
You can get specific version of WebKit installer from below link,   
   
After installing WebKit HTML converter you can get QtBinaries from the WebKit installed location.    
Example: $System Drive:\Program Files (x86)\Syncfusion\WebKitHTMLConverter\XX.X.X.XX    
   
If still get the same error, please provide the product version, VS version, code snippet and environment details (OS, bit version, culture setting etc.). So, that it will helpful for us to proceed further.    
 
Regards, 
Prakash V 


Vhalaky
Replied On August 4, 2017 10:01 AM UTC

Hi,I checked the versions (VS Path): C:\Program Files (x86)\Syncfusion\Essential Studio\15.1.0.33\Assemblies\4.6\Syncfusion.Compression.Base.dllC:\Program Files (x86)\Syncfusion\Essential Studio\15.1.0.33\Assemblies\4.6\Syncfusion.HtmlConverter.Base.dllC:\Program Files (x86)\Syncfusion\Essential Studio\15.1.0.33\Assemblies\4.6\Syncfusion.Pdf.Base.dllI copied the full QtBinaries folder from here: c:\Program Files (x86)\Syncfusion\WebKitHTMLConverter\15.1.0.33\QtBinaries\So I think it should not be a version problem.And in a separated, small project it is working (with same assemblies + webkit).

Vhalaky
Replied On August 4, 2017 10:03 AM UTC

-- I edited my previous post but new lines are disappeared --

Hi,

I checked the versions (VS Path):

C:\Program Files (x86)\Syncfusion\Essential Studio\15.1.0.33\Assemblies\4.6\Syncfusion.Compression.Base.dll

C:\Program Files (x86)\Syncfusion\Essential Studio\15.1.0.33\Assemblies\4.6\Syncfusion.HtmlConverter.Base.dll

C:\Program Files (x86)\Syncfusion\Essential Studio\15.1.0.33\Assemblies\4.6\Syncfusion.Pdf.Base.dll

I copied the full QtBinaries folder from here: c:\Program Files (x86)\Syncfusion\WebKitHTMLConverter\15.1.0.33\QtBinaries\

So I think it should not be a version problem.

And in a separated, small project it is working (with same assemblies + webkit).


Vhalaky
Replied On August 4, 2017 10:15 AM UTC

The problem is the hungarian accented letters in the path of program folder. Can I solve this? It is a multilingual software so various letters can be in the program path.


Prakash Viswanathan [Syncfusion]
Replied On August 7, 2017 09:27 AM UTC

Hi Mate, 
 
Thanks for your update. 
 
We were able to reproduce the reported error and we have confirmed this as a bug and logged a defect report on this. Also, we have created a support incident under your account to track the status of this issue.  
                                                      
Please log on to our support website to check for further updates.  
 
Regards, 
Prakash V 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;