This is a migrated thread and some comments may be shown as answers.

Radeditor export to PDF with images throws error

2 Answers 103 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Rick Rehorst
Top achievements
Rank 1
Rick Rehorst asked on 09 Feb 2012, 12:12 AM
Hi guy's

I'm using Radeditor on a ASP.Net webpage using VB.NET
On the page I use an radeditor with enabled = false just to show HTML content and use some features of the editor.

The content below is sample content and when I try to export to PDF it gives me an error.
When I remove the image all works fine.

I used the sample database content provider and everything worked fine except the export to PDF with images having that database path still in the source string.

So I made my program that the images are stored in the db manually and just before loading the content I load the images from the db manually so that the images in the content can use local (virtual) references.

Does anybody see what's wrong with the image in my sample content and especially the image waterlelies.jpg ??

The error comes after i clicked "open" in the pdf dialog and it say's that de pdf cannot be opened because the filetype is not supported by acrobat reader. If I save the pdf it's size is 0kb ...

Where can I see more detaild error subscription?

Regards,

Rick Rehorst

Sample content:
h2 id="H1.0"><span style='color: #e36c09; font-size: 18px;'>Hoofdstuk 1</span></h2><br/>Dit is een test voor klant 8<br />
<br />
Ik kan hier plaatjes invoegen<br />
<br />
<span style="font-family: ms sans serif;">Een ander lettertype selecteren<br />
</span><br />
en een opssomminkje maken<br />
<ul>
    <li>test</li>
    <li>test2</li>
    <li>test3</li>
    <li><fieldset style="width: 200px; height: 76px;"><legend>Title</legend>Content... </fieldset> </li>
</ul><h2 id="H1.1"><span style='color: #e36c09; font-size: 18px;'>1.1 Gegevens</span></h2><br/><img alt="" src="/RadControlsWebSite1/imgtemp/Waterlelies.jpg" />Empty <br />
<br /><h2 id="H1.2"><span style='color: #e36c09; font-size: 18px;'>1.2 Beschrijving</span></h2><br/>Empty <br />
<br /><h2 id="H2.0"><span style='color: #e36c09; font-size: 18px;'>Hoofdstuk 2</span></h2><br/>Dit is hoofdstuk 2<br />
<br /><h2 id="H2.1"><span style='color: #e36c09; font-size: 18px;'>2.1 Gegevens</span></h2><br/>Empty <br />
<br /><h2 id="H3.0"><span style='color: #e36c09; font-size: 18px;'>Hoofdstuk 3</span></h2><br/>Empty <br/><br/><h2 id="H4.0"><span style='color: #e36c09; font-size: 18px;'>Hoofdstuk 4</span></h2><br/>Dit is Hoofdstuk 4<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
<p>Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
Dit ook<br />
<br />
<br />
</p>

2 Answers, 1 is accepted

Sort by
0
Rick Rehorst
Top achievements
Rank 1
answered on 10 Feb 2012, 01:26 PM
Found the solution

In my source the path for the image = /radcontrolswebsite1/imgtemp/<imagename>....

It should be "imgtemp/<imagename> 

Now the question is:

During the Page Load event I put the imagemanagerpaths to:

 

 

RadEditorTemp.ImageManager.ViewPaths = New String() {"~/imgtemp"}
RadEditorTemp.ImageManager.UploadPaths = New String() {"~/imgtemp"}
RadEditorTemp.ImageManager.DeletePaths = New String() {"~/imgtemp"}


When I insert an image via the manager, in the HTML view the path appears as:

 

/RadcontrolsWebsite1/imgtemp/<imagename>..

WHY ??

Now I have to execute a replace method everytime I save the content.


0
Accepted
Rumen
Telerik team
answered on 13 Feb 2012, 12:50 PM
Hello,

This is a limitation of the third party export to PDF tool that RadEditor uses to provide this functionality. The project name in the path is added by the browser. If you would like you can make the path replace in the OnClientPasteHtml event of the TemplateManager and insert images with paths in the content area that the Export to PDF converted will understand and export.

Best regards,
Rumen
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Editor
Asked by
Rick Rehorst
Top achievements
Rank 1
Answers by
Rick Rehorst
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or