problem with paste from Internet page

General TRichView support forum. Please post your questions here
Post Reply
chubb
Posts: 6
Joined: Thu Dec 18, 2008 10:15 am

problem with paste from Internet page

Post by chubb »

Hello
I have a problem with RichViewEdit

when I paste some text with pictures into RV - I'm getting an error:
Project raised exeption class EFopenError with message 'Cannot open file D:\Project\http:\<site>\logo.gif'. Syntax error....
I found some solution on the forum (http://www.trichview.com/forums/viewtop ... light=http), but I didtn't chatch the idea of it
how to fill in liste_images in remixtech's reply?

can anyone help me?

thanks
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Does your application support gif images? See here: http://www.trichview.com/forums/viewtopic.php?t=89
chubb
Posts: 6
Joined: Thu Dec 18, 2008 10:15 am

Post by chubb »

yes
I've got included GifImage.pas
and no matter is it gif or jpg file
reaction is the same
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Well, I can see that the problem is not in gif, but in invalid file name. Obviously, D:\Project\http:\<site>\logo.gif is not a valid file name.
Please send me these files, I'll try to see what's wrong.
chubb
Posts: 6
Joined: Thu Dec 18, 2008 10:15 am

Post by chubb »

Sergey Tkachenko wrote:Well, I can see that the problem is not in gif, but in invalid file name. Obviously, D:\Project\http:\<site>\logo.gif is not a valid file name.
this is a problem, for sure
Sergey Tkachenko wrote:Please send me these files, I'll try to see what's wrong.
which files i should send to you?

I can't understand why filename "D:\Project\http:\<site>\logo.gif" appears.

thank you
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

HTML files, from where you pasted
chubb
Posts: 6
Joined: Thu Dec 18, 2008 10:15 am

Post by chubb »

Sergey Tkachenko wrote:HTML files, from where you pasted
it happens when copy-pasting from any internet page

i've noticed that while runing project from Delphi (building) - I'm getting mentioned exception
but when I run copmiled .exe file - I don't get an exception though instead of picture I have blank picture in RV
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

1. What page (URL) do you copy from?
2. What browser do you use for copying?
3. Do you paste in HTML format using TrvHtmlImporter, or RTF (without using it)?
chubb
Posts: 6
Joined: Thu Dec 18, 2008 10:15 am

Post by chubb »

Sergey Tkachenko wrote:1. What page (URL) do you copy from?
any page :) fo example http://www.trichview.com/ title page :)
Sergey Tkachenko wrote:2. What browser do you use for copying?
IE 7, FF3
Sergey Tkachenko wrote:3. Do you paste in HTML format using TrvHtmlImporter, or RTF (without using it)?
I copy directly from page to clipboard and than paste to RichViewEdit

I don't know how to make it, but I just want to save HTML page with copy-paste operations
I don't care about styles and CSS. I just want pictures and text saved to RV

thanks
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I cannot reproduce this problem when copying from www.trichview.com.
When I copy from IE7 to to RichViewEdit without assigned events, it attempts to load pictures from their original locations (such as "http://www.trichview.com/images/headers/news.gif"). Of course it fails because images need to be downloaded.

Or may be you paste into ActionTest demo with Indy support turned on?
What version of TRichView do you use?

In order to help you, I need a detailed instructions how to reproduce this problem, because all works fine on my side.
chubb
Posts: 6
Joined: Thu Dec 18, 2008 10:15 am

Post by chubb »

Happy New Year and Merry Christmas!
Sergey Tkachenko wrote:I cannot reproduce this problem when copying from www.trichview.com.
When I copy from IE7 to to RichViewEdit without assigned events, it attempts to load pictures from their original locations (such as "http://www.trichview.com/images/headers/news.gif").
Of course it fails because images need to be downloaded.
ok, can you advise me what actions should I do to download images, save them in temporary files and than paste in RV as it looks on web-page?
may be there is an example somewhere?
Sergey Tkachenko wrote:Or may be you paste into ActionTest demo with Indy support turned on?
What version of TRichView do you use?
10
Sergey Tkachenko wrote:In order to help you, I need a detailed instructions how to reproduce this problem, because all works fine on my side.
I thik that main issue is "it fails because images need to be downloaded"
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If the problem was because images not downloaded, the error message would be like 'Cannot open file http://www.somesite.com/logo.gif', i.e. picture name would be a correct URL...
I recommend to update to TRichView 11. It has some fixes when importing documents with external images.

As for downloading.
If you use RichViewActions, they do this work automatically. Just enable support for Indy: http://www.trichview.com/help-actions/indy.htm

If you do not use RichViewActions, process RichViewEdit.OnImportPicture event. In this event, if the path parameter is a http location, download the image in a temporal location (using TIdHttp component, for example), then insert this picture. I currently only have an example with TrvHtmlImporter ( http://trichview.com/resources/html/rvhtml_indy.zip ) This example uses TrvHtmlImporter's event, so it needs to be corrected to use RichViewEdit.OnImportPicture.
Post Reply