You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a image that is fixed size and is in 300 DPI. We want to add that image in the PDF. On doing so when we add the image in the PDF using Unidoc unipdf, the image overall size is reducing.
Expected Behavior
Since the size of the image and DPI is fixed i.e. DPI is 300 the size of the image in the output PDF should be of the same size as provided
Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/
Hi @Mahendershah I do not recall seeing this reported in our service desk? Was it filed there, and has this been resolved? Would be good to close.
There was a fix related to image optimization with PPI settings in the newest release https://github.com/unidoc/unipdf/releases/tag/v3.27.0
Description
We have a image that is fixed size and is in 300 DPI. We want to add that image in the PDF. On doing so when we add the image in the PDF using Unidoc unipdf, the image overall size is reducing.
Expected Behavior
Since the size of the image and DPI is fixed i.e. DPI is 300 the size of the image in the output PDF should be of the same size as provided
Actual Behavior
Steps to reproduce the behavior:
pageSize := creator.PageSize{creator.PageSizeA4[0], creator.PageSizeA4[1]}
c.SetPageSize(pageSize)
c.NewPage()
img, err := getImage(c, imgPath, 22.2, 18.8, 80.35)
_ = c.Draw(img)
c.SetOptimizer(optimize.New(optimize.Options{
ImageQuality: 300,
ImageUpperPPI: 300,
}))
The above bold text shows how we are specifying the Optimizer to create 300 DPI image.
func getImage(c *creator.Creator, imgPath string, x float64, y float64, w float64) (*creator.Image, error) {
img, err := c.NewImageFromFile(imgPath)
if err != nil {
common.Log.Debug("Error loading image: %v", err)
return nil, err
}
}
Attachments
None
The text was updated successfully, but these errors were encountered: