Hi -- I am using trichview to create large documents with many (>150) full screen bitmaps. Psuedo code looks something like this...(apologies for poor formatting, my spacing is being deleted by the board)
Source := tjpegimage.create;
for i := 1 to numpages do
begin
PageNum := PageNum +1;
NextItem := rvReport.ItemCount;
rvReport.PageBreaksBeforeItems[rvReport.ItemCount-1]:=TRUE;
Try
Screen := tBitMap.Create;
Source.LoadFromFile(CurrentPage.Path);
Source.Scale := jsHalf;
Screen.Assign(Source);
rvReport.AddFromNewLine(' ',NORMAL);
rvReport.AddPicture(Screen);
//Screen.Dormant;
//Screen.FreeImage;
//Screen.Free;
Except on E:Exception Do
showmessage(E.Message);
End;
end
Lots of detail left out, but that is the basic idea. Note the three commented lines...this uses a ton of memory, and on larger reports, I exhuast the machine so badly it wanders off and gets lost. I would like to find a more efficient method...but I cannot do the freeing in the three commented lines, since AddPicture needs the bitmap in place until the report is done, right? Any suggestions...these reports could be in the many hundreds of bitmaps. Any ideas greatly appreciated.
Large Docs with Many Pictures
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Converting to PDF
Okay, I have cleaned that up a bit and it is working better now, and clearing the report when I am done frees the memory. Next question, I offer the user the ability to save to PDF, using RolePDF dll -- this takes a L O N G time...is there a progress indicater from within the RodePDF system that I am unaware of that I could use to let the user know how things were progressing? Thanx.
Sincerely,
David
Sincerely,
David
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Progress for SaveRTF, and RTF File Size
Sergey -- Okay, they were very helpful and that is working better now. Now is there some way to do the same for SaveRTF -- a progress indicator to let the user know how the save was going? Some of my clients are saving reports > 500 pages, and while SaveRTF is much faster than PDF, it still takes a while.
Also, the RTF files created are VERY large...I am sure this is at least partly because of the high volume of screenshots...one per page...is there anything I can do to generate smaller RTF files? I have looked at the options a little, since I am doing an assign to a tjpgimage from a Bitmap, will the SaveJpgAsJpg option buy me anything? Currently the files on disk are actually jpg, but I use TBitmap as a generic image handler, as I was considering opening the file format up later as user selectable option.
Any help greatly appreciated.
Sincerely,
David
Also, the RTF files created are VERY large...I am sure this is at least partly because of the high volume of screenshots...one per page...is there anything I can do to generate smaller RTF files? I have looked at the options a little, since I am doing an assign to a tjpgimage from a Bitmap, will the SaveJpgAsJpg option buy me anything? Currently the files on disk are actually jpg, but I use TBitmap as a generic image handler, as I was considering opening the file format up later as user selectable option.
Any help greatly appreciated.
Sincerely,
David
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yes, it's better to use TJpegImage, and include SaveJpgAsJpg in RTFOptions.
Images will be saved as jpegs in RTF, so it will be MUCH smaller.
I do not know a nature of your pictures. If they are photos, and especially if the source images are jpegs, storing them as jpegs is the best option.
If they are screenshots, it's better to use PNG instead:
http://www.trichview.com/forums/viewtopic.php?t=89
(but if their quality is already degraded because of saving to jpegs, it does not make sense)
Images will be saved as jpegs in RTF, so it will be MUCH smaller.
I do not know a nature of your pictures. If they are photos, and especially if the source images are jpegs, storing them as jpegs is the best option.
If they are screenshots, it's better to use PNG instead:
http://www.trichview.com/forums/viewtopic.php?t=89
(but if their quality is already degraded because of saving to jpegs, it does not make sense)