Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, October 20, 2009 9:57:05 PM(UTC)


Groups: Registered
Posts: 7

I have a problem:
Some times I need to delete some page of a document and other times I need to replace a concrete page.
I need to do this directly from the file in the disk (not from memory).
I use the following methods:
rasterCodecs.DeletePage("Doc01.tif", pageIndex);
rasterCodecs.Save(image, "Doc01.tif", RasterImageFormat.TifLzw, 0, 1, 1, pageIndex, CodecsSavePageMode.Replace);

The problem is that when I use this methods the file size don't decrement, and if I have 5 pages and I delete 4 pages, the document still occupy the same as if it has 5 pages.
The same occurs if I have a document of 2 pages, I replace one page, and the document now occupy the same as before plus the size of the page I replace (now occupy like if it has 3 pages).

What are wrong with that methods? or with my code?

I am using LeadTools (version info

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, October 21, 2009 4:40:59 AM(UTC)

Adam Boulad  

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

The CodecsSavePageMode.Replace option will flag the page as deleted without actually deleting it. If you want to replace the entire file, you can use the CodecsSavePageMode.Overwrite option or just use the RasterCodecs.CompactFile Method to compact and clean the file from the deleted pages.
#3 Posted : Thursday, October 22, 2009 10:19:32 PM(UTC)


Groups: Registered
Posts: 7

Thanks, now works correctly!
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.053 seconds.