AddEmbeddedImageAnnot and file size when burn without vector

Discussions about PDF management.
Post Reply
rlagrange
Posts: 30
Joined: Tue May 02, 2017 5:51 pm

AddEmbeddedImageAnnot and file size when burn without vector

Post by rlagrange » Wed May 10, 2017 3:12 pm

Hi,

We are having trouble generating small file with embedded image annotations.
On CloseDocument, we burn annotation to pages.

We test both VectorMode possibilities, and while VectorMode=true give good result in term of file size, the quality of the annotation is very poor.
with VectorMode=false, the quality is good, but the file size is ugly.

For example, an input of 22 pages files containing B&W MRC. Initial file size : 2.2MB.
Adding a colored stamp on each page : final size : 23.5MB without vector, 2.5MB with vector.

The initial stamp is a png of 5KB, but is composed as a Bitmap before being added.

Now, we are going deeper, using PDFXplorer to see the exact content of the output file.
When using vectorMode=false, it look like the whole page is rasterized as a single resource. Of course, the B&W MRC become an RGB with the colored stamp, which is huge.
While using vectorMode=true the initial resources are mostly untouched, and the annot is a new independent resource.

Question is :
- is it possible to improve the quality of the EmbeddedImageAnnot when burned as a vector ? (preferred solution)
- or is it possible to NOT Rasterize the page when an EmbeddedImageAnnot is burned without vector ?

Bonus question :
Is it possible to share an annotation between multiple page, to prevent duplication of the picture resource ?

Thanks.

rlagrange
Posts: 30
Joined: Tue May 02, 2017 5:51 pm

Re: AddEmbeddedImageAnnot and file size when burn without vector

Post by rlagrange » Wed May 10, 2017 4:49 pm

After further research, it look like the vector resource is embedded with a correct quality, so I think that it's the SMASK which cause the text to be blurry.

Please find the input and output here :
https://drive.google.com/open?id=0B76C2 ... HhhYlJDMkk

rlagrange
Posts: 30
Joined: Tue May 02, 2017 5:51 pm

Re: AddEmbeddedImageAnnot and file size when burn without vector

Post by rlagrange » Mon May 15, 2017 6:01 pm

Hi,

Is this issue being reviewed ?

Thanks.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: AddEmbeddedImageAnnot and file size when burn without vector

Post by Loïc » Wed May 17, 2017 3:54 pm

Hello,

You can control the quality and compression scheme of each embedded images of a PDF using the GdPicturePDF class.

So in you case I suggest you to:

- load the PDF document using the GdPicturePDF class
- choose your favorite image compression mode / quality. IE: https://www.gdpicture.com/guides/gdpicture/web ... ality.html
- load the GdPicturePDF object into an AnnotationManager object.
- burn the annotations.

Please let me know if you need further information.

With best regards,

Loïc

rlagrange
Posts: 30
Joined: Tue May 02, 2017 5:51 pm

Re: AddEmbeddedImageAnnot and file size when burn without vector

Post by rlagrange » Fri May 19, 2017 5:04 pm

The compression were already enabled.
It's the first thing I do when I open the initial pdf.

I just tried with the latest gdpicture 14, and I reproduce the issue.

rlagrange
Posts: 30
Joined: Tue May 02, 2017 5:51 pm

Re: AddEmbeddedImageAnnot and file size when burn without vector

Post by rlagrange » Fri May 19, 2017 5:34 pm

The issue is reproduceable with small modification of your C# Annotation Sample.
Change the BurnAnnotationsToPage call, to set vectorMode parameter to false
Run it

Load the source file
Add embedded image annotation and select the input stamp provided, then burn the annotation.
Repeat on some pages.
Save

The file size did grow significantly, regardless of the compression mode.
You'll also see that when clicking the "burn" button, the stamp quality is greatly improve, regarding the same operation without the vectorMode parameter.

Please investigate.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests