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

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, July 21, 2020 12:40:53 AM(UTC)
Abdul Rahman

Groups: Registered
Posts: 60


I'm exporting my documents using RasPdfLzw format. This format against any document or pdf itself is ending up with more than 15 times big file size with annotation. But in the viewer Export Document Dialog, I can see a Document Format along with Raster Format. What is Document Format? Does that help in size reduction?

Code:

var outputStream = new MemoryStream();
using var codecs = new RasterCodecs();
codecs.Options.Pdf.InitialPath = $@"{Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}{Path.DirectorySeparatorChar}LeadTools CDLL";
codecs.Options.Load.Name = $"anything.{documentExtension}";
codecs.Options.Load.AllPages = true;
var originalImage = codecs.Load(documentPath);
codecs.Save(originalImage, outputStream, RasterImageFormat.RasPdfLzw, 0, 1, originalImage.PageCount, firstPageNumber, CodecsSavePageMode.Append);


Do we have anything like RasterImageFormat.Document ? Please Assist. Attached the export dialog image for your reference.

Export Document.png
 

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, July 22, 2020 8:05:57 AM(UTC)

Hadi  
Hadi

Groups: Manager, Tech Support, Administrators
Posts: 218

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

Abdul,

The DocumentFormat is a vector based format which means there are no images or anything inside the PDF - only text, which is why it is so much smaller.

If you don't want any images in the output, then use the DocumentFormat.PDF which will generate the smallest possible PDF file with text only:

https://www.leadtools.co...iter-documentformat.html

Thanks,
Hadi
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.

LEAD Logo
 
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.042 seconds.