LEADTOOLS Support
Document
Document SDK Questions
PDF's file size is larger than original when it re-saved after Rotating
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, August 11, 2010 12:21:26 AM(UTC)
Groups: Registered
Posts: 8
hello
I get the multi-pdf flie by scanning,like this:
_codecs.Options.Pdf.Save.UseImageResolution = True
_codecs.Save(e.Image, filename, RasterImageFormat.RasPdfG4, 1, 1, 1, 1, CodecsSavePageMode.Append)
Then I Rotated the image in viewer,and then save one of it again,like this:
Dim listItem As RasterImageListItem = _thumb.SelectedItems(0)
_codecs.Options.Pdf.Save.UseImageResolution = True
_codecs.Save(listItem.Image, filename, RasterImageFormat.RasPdfG4, 1, listItem.Page, listItem.Page, listItem.Page, CodecsSavePageMode.Replace)
The original size is 845kb,and the re-saved size is 2949kb.The more I saved it,the more it increased.
Could you tell me how can I retain the size after saving it?
Thank you.
#2
Posted
:
Wednesday, August 11, 2010 1:08:27 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Can you send me a small working project (NOT your full application) with minimum code required that shows how exactly are you loading, rotating and saving your PDF file? Also, that shows the rotation degree you are using to rotate your PDFs.
If you create such a project, please make sure to put it in a ZIP or RAR file before posting it here.
#3
Posted
:
Wednesday, August 11, 2010 2:14:57 AM(UTC)
Groups: Registered
Posts: 8
OK.I have send the sample in my project.
I use the save method in the DragDrop(),RotateLeft(),RotateRight() and DeskewCheckCommandExample() functions.
The pdf file which I saved from the scanner is also send.
Thank you.
#4
Posted
:
Thursday, August 12, 2010 12:51:06 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Since you are using the CodecsSavePageMode.Replace flag in the Save method, the file size will continue to grow every time you call the Save method because the original pages in your file are not physically deleted.
This is how the Replace operation works with PDF files. The old page is marked as 'deleted', but it remains in the file.
To solve this issue:
1- Change the output file name and use the CodecsSavePageMode.Overwrite flag to save the first page.
2- After that use the CodecsSavePageMode.Append to add the other pages to your new file.
#5
Posted
:
Friday, August 13, 2010 3:22:39 AM(UTC)
Groups: Registered
Posts: 8
Thank you.
But when lots of images in this multi-file,it has to save the all images again when I only modify the one of these.It seems too slow to save it.
How can I save this multi-file quickly ?
#6
Posted
:
Sunday, August 15, 2010 1:38:54 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
For PDF files, this is the way to save all the pages even after modifying one page of the file.
With multi-page TIFF files, you can use the CompactFile method enables you to copy or extract one or more pages from a TIFF file and copy them without recompression to another TIFF file.
If you like I can submit a feature to our engineers to add similar function for PDF file format. To add the feature, please send me the following info to
support@leadtools.com from a valid email address:
- Your LEADTOOLS toolkit serial number. (Do NOT post it here)
- A link to this forum post.
LEADTOOLS Support
Document
Document SDK Questions
PDF's file size is larger than original when it re-saved after Rotating
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.