gographics / imagick

Go binding to ImageMagick's MagickWand C API
https://godoc.org/github.com/gographics/imagick/imagick
Other
1.75k stars 182 forks source link

When PDF converted to PNGs, white margin is lost #290

Closed agarwalanirudh closed 1 year ago

agarwalanirudh commented 1 year ago

Upon converting PDF to PNG, it is losing white margins. Although the issue gets fixed upon trying JPG. Is there a way to retain white margins in PNG?

image
justinfx commented 1 year ago

Seems like a question better suited for the ImageMagick forum. Did you try reading about how to control the page and crop sizes? https://www.imagemagick.org/Usage/crop/#crop_repage

Possibly: https://pkg.go.dev/gopkg.in/gographics/imagick.v3/imagick?utm_source=godoc#MagickWand.SetImagePage or https://pkg.go.dev/gopkg.in/gographics/imagick.v3/imagick?utm_source=godoc#MagickWand.ResetImagePage