diff --git a/fpdf.go b/fpdf.go index 0246cab..db8f83d 100644 --- a/fpdf.go +++ b/fpdf.go @@ -223,7 +223,7 @@ func fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr string, size SizeType, // alternative to New() that provides additional customization. The PageSize() // example demonstrates this method. func NewCustom(init *InitType) (f *Fpdf) { - return fpdfNew(init.OrientationStr, init.UnitStr, init.SizeStr, init.FontDirStr, init.Size) + return fpdfNew(init.OrientationStr, init.UnitStr, init.SizeStr, init.FontDirStr, init.Size, init.Density) } // New returns a pointer to a new Fpdf instance. Its methods are subsequently @@ -246,8 +246,8 @@ func NewCustom(init *InitType) (f *Fpdf) { // reference an actual directory if a font other than one of the core // fonts is used. The core fonts are "courier", "helvetica" (also called // "arial"), "times", and "zapfdingbats" (also called "symbol"). -func New(orientationStr, unitStr, sizeStr, fontDirStr string) (f *Fpdf) { - return fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr, SizeType{0, 0}) +func New(orientationStr, unitStr, sizeStr, fontDirStr string, density float64) (f *Fpdf) { + return fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr, SizeType{0, 0}, density) } // Ok returns true if no processing errors have occurred. @@ -3079,12 +3079,12 @@ func (f *Fpdf) imageOut(info *ImageInfoType, x, y, w, h float64, allowNegativeX, // // Deprecated in favor of ImageOptions -- see that function for // details on the behavior of arguments -func (f *Fpdf) Image(imageNameStr string, x, y, w, h float64, flow bool, tp string, link int, linkStr string) { +func (f *Fpdf) Image(imageNameStr string, x, y, w, h float64, flow bool, tp string, link int, linkStr string, density float64) { options := ImageOptions{ ReadDpi: false, ImageType: tp, } - f.ImageOptions(imageNameStr, x, y, w, h, flow, options, link, linkStr) + f.ImageOptions(imageNameStr, x, y, w, h, flow, options, link, linkStr, density) } // ImageOptions puts a JPEG, PNG or GIF image in the current page. The size it diff --git a/template_impl.go b/template_impl.go index c1e2dff..f98f422 100644 --- a/template_impl.go +++ b/template_impl.go @@ -26,10 +26,10 @@ import ( */ // newTpl creates a template, copying graphics settings from a template if one is given -func newTpl(corner PointType, size SizeType, orientationStr, unitStr, fontDirStr string, fn func(*Tpl), copyFrom *Fpdf) Template { +func newTpl(corner PointType, size SizeType, orientationStr, unitStr, fontDirStr string, density float64, fn func(*Tpl), copyFrom *Fpdf) Template { sizeStr := "" - fpdf := fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr, size) + fpdf := fpdfNew(orientationStr, unitStr, sizeStr, fontDirStr, size, density) tpl := Tpl{*fpdf} if copyFrom != nil { tpl.loadParamsFromFpdf(copyFrom)