pdfcpu / pdfcpu

A PDF processor written in Go.

Home Page:http://pdfcpu.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disable centered content when resize page.

MiyamuraMiyako opened this issue · comments

The following code will increase the height of the page, but the content will also be centered. How to prevent the content from being centered?

func main() {
	dimList, err := api.PageDimsFile("1.pdf")
	if err != nil {
		fmt.Println(err)
	}
	dimList[0].Height *= 2

	err = api.ResizeFile("1.pdf", "2.pdf", []string{}, &model.Resize{
		PageDim: &dimList[0],
	}, nil)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println("ok")
}

Yes, right now, resize will always center page content within the destination page size/dimensions.