AddEmbeddedImageAnnot and file size when burn without vector
AddEmbeddedImageAnnot and file size when burn without vector
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.
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.
Re: AddEmbeddedImageAnnot and file size when burn without vector
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
Please find the input and output here :
https://drive.google.com/open?id=0B76C2 ... HhhYlJDMkk
Re: AddEmbeddedImageAnnot and file size when burn without vector
Hi,
Is this issue being reviewed ?
Thanks.
Is this issue being reviewed ?
Thanks.
Re: AddEmbeddedImageAnnot and file size when burn without vector
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
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
Re: AddEmbeddedImageAnnot and file size when burn without vector
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.
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.
Re: AddEmbeddedImageAnnot and file size when burn without vector
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.
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.
Who is online
Users browsing this forum: Google [Bot] and 1 guest