the size of save files in too big
the size of save files in too big
Hi again Sergey
I have another issue. I have small document with some pictures in it, not too big. between 40kb and 100 kb each one. When I save this document to rvf file, the filesize is 3249 kb. If I copy the document content and I paste it in Word, and then Isave this file, the file size is 365 kb, which is normal according with the size of the pictures stored.
What can be wrong?
if you want I can send you the generate rvf file.
Regards
Jesus
I have another issue. I have small document with some pictures in it, not too big. between 40kb and 100 kb each one. When I save this document to rvf file, the filesize is 3249 kb. If I copy the document content and I paste it in Word, and then Isave this file, the file size is 365 kb, which is normal according with the size of the pictures stored.
What can be wrong?
if you want I can send you the generate rvf file.
Regards
Jesus
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Try calling
before saving.
If it does not help, send a sample rtf to me to richviewgmailcom.
Code: Select all
SRV.RichViewEdit.DeleteUnusedStyles(True, True, True);
SRV.RVHeader.DeleteUnusedStyles(True, True, True);
SRV.RVFooter.DeleteUnusedStyles(True, True, True);
If it does not help, send a sample rtf to me to richviewgmailcom.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I received your files.
You have a jpeg picture, but in RVF and RTF it is stored as a metafile containing a bitmap. Of course, a bitmap size is greater than a jpeg size.
How could it happen?
For RTF, it may happen if you excluded rvrtfSaveJpegAsJpeg from SRV.RTFOptions.
For RVF, image formats are not converted, so jpeg cannot be converted to a metafile or any other format when saving RVF.
So I believe this RVF is created after loading RTF file containing a metafile.
You have a jpeg picture, but in RVF and RTF it is stored as a metafile containing a bitmap. Of course, a bitmap size is greater than a jpeg size.
How could it happen?
For RTF, it may happen if you excluded rvrtfSaveJpegAsJpeg from SRV.RTFOptions.
For RVF, image formats are not converted, so jpeg cannot be converted to a metafile or any other format when saving RVF.
So I believe this RVF is created after loading RTF file containing a metafile.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Hi Sergey
I do not use another class for Jpeg.
This is what I do, maybe this can helps you to find out what is happening.
1) I create a new empty document
2) Insert the image I sent to you 45 kb.
3) Export to RVF file then I get 49 kb. Good.
4) Instead of Export I sabe the document in RTF Format stored in a stream. using these lines of code.
SRichViewEdit1.RichViewEdit.Modified := False;
FDataStream.Clear;
FDataStream.Position := 0;
SRichViewEdit1.RichViewEdit.SaveRTFToStream( FDataStream,False );
5) Close the document, and I reopen it but this time loading its content from the stream.
6) I try to export the document in RVF Format and then I get a file wiht 243 kb, which is not good.
I think the problem is when I store the document in the stream. Can be?
Please let me know...
Regards
Jesus
I do not use another class for Jpeg.
This is what I do, maybe this can helps you to find out what is happening.
1) I create a new empty document
2) Insert the image I sent to you 45 kb.
3) Export to RVF file then I get 49 kb. Good.
4) Instead of Export I sabe the document in RTF Format stored in a stream. using these lines of code.
SRichViewEdit1.RichViewEdit.Modified := False;
FDataStream.Clear;
FDataStream.Position := 0;
SRichViewEdit1.RichViewEdit.SaveRTFToStream( FDataStream,False );
5) Close the document, and I reopen it but this time loading its content from the stream.
6) I try to export the document in RVF Format and then I get a file wiht 243 kb, which is not good.
I think the problem is when I store the document in the stream. Can be?
Please let me know...
Regards
Jesus
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I received it. As I expected, this jpeg was loaded not in TJPEGImage but in another class, TdxSmartImage.
TRichView knows nothing about TdxSmartImage, so it cannot save it to RTF as Jpeg.
Solution:
1) Compile your application without DXREGISTERPNGIMAGE define. If it is not defined, DevExpress code does not register TdxPNGImage for PNG, and TdxSmartImage for TIF GIF PNG JPG JPEG, so standard VCL classes will be used.
or
2) You can subclass TRVGraphicHandler to support DevExpress classes. I can explain how to do it, if you need.
TRichView knows nothing about TdxSmartImage, so it cannot save it to RTF as Jpeg.
Solution:
1) Compile your application without DXREGISTERPNGIMAGE define. If it is not defined, DevExpress code does not register TdxPNGImage for PNG, and TdxSmartImage for TIF GIF PNG JPG JPEG, so standard VCL classes will be used.
or
2) You can subclass TRVGraphicHandler to support DevExpress classes. I can explain how to do it, if you need.
Sergey
First of all, thanks a lot for your help
1) I have bough and installed Devpress Components, but I do use them in my application, so DXREGISTERPNGIMAGE is no defined. So I do not find any explanation why my application is using TdxSmartImage instead. This is something that I have to figure out.
2) About subclass TRVGraphicHandler to support DevExpress classes. Can you tell how to do it.
Once more, thanks
Regards
Jesus
First of all, thanks a lot for your help
1) I have bough and installed Devpress Components, but I do use them in my application, so DXREGISTERPNGIMAGE is no defined. So I do not find any explanation why my application is using TdxSmartImage instead. This is something that I have to figure out.
2) About subclass TRVGraphicHandler to support DevExpress classes. Can you tell how to do it.
Once more, thanks
Regards
Jesus
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
RVGraphicHandler already supports TdxPngImage (if RVUSEDXPNGIMAGE is defined in RV_Defs.inc), so it makes sense to expand it for TdxSmartImage).
Also, I added a new method RVGraphicHandler.RegisterJpegGraphic allowing to change the default class for JPEGS (it will be used, for example, when loading RTF with jpegs).
It will be included in the next update.
PS: I reopened private forums for your account.
Also, I added a new method RVGraphicHandler.RegisterJpegGraphic allowing to change the default class for JPEGS (it will be used, for example, when loading RTF with jpegs).
It will be included in the next update.
PS: I reopened private forums for your account.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
In your existing documents, images are stored as metafiles.
You can convert all images in documents to jpegs ( http://www.trichview.com/forums/viewtopic.php?t=761 - example for C++Builder, I can convert it to Delphi, if you need).
However, JPEGs are good only for photos. If you have screenshots of schemes containing clear lines or text, converting them to JPEG will noticeable decrease quality.
You can convert all images in documents to jpegs ( http://www.trichview.com/forums/viewtopic.php?t=761 - example for C++Builder, I can convert it to Delphi, if you need).
However, JPEGs are good only for photos. If you have screenshots of schemes containing clear lines or text, converting them to JPEG will noticeable decrease quality.