Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi I can't fix this bug #7

Open
pathbox opened this issue Nov 26, 2018 · 3 comments
Open

Hi I can't fix this bug #7

pathbox opened this issue Nov 26, 2018 · 3 comments

Comments

@pathbox
Copy link

pathbox commented Nov 26, 2018

This is my code

package main

import (
	"fmt"
	"io/ioutil"

	"github.com/signintech/pdft"
)

func main() {

	target := "out_pdf.pdf"
	pdfsource := "Bussiness.pdf"
	picPath :=  "17.jpg"

	var ipdf pdft.PDFt
	err := ipdf.Open(pdfsource)
	if err != nil {
		panic(err)
	}

	pic, err := ioutil.ReadFile(picPath)
	if err != nil {
		panic("Couldn't read pic.")
	}

	//insert image to pdf
	err = ipdf.InsertImg(pic, 1, 1.0, 1.0, 600.0, 600.0)
	if err != nil {
		panic("Couldn't insert image")
	}

	err = ipdf.Save(target)
	if err != nil {
		fmt.Println(err)
		panic("Couldn't save pdf.")
	}
}
not found /Resources in /Type/Pages
panic: Couldn't save pdf.

goroutine 1 [running]:
main.main()
	/Users/pathbox/code/learning-go/src/pdf-power/pdft-example.go:36 +0x1bf
exit status 2

Can you help me

@signintech
Copy link
Owner

Can you give me the pdf source file (Bussiness.pdf), so I can further check.

@pathbox
Copy link
Author

pathbox commented Nov 27, 2018

@signintech Can you give me you email please? I email to you. The PDF file is a word docx file then save to PDF file with windows office 2010

@oneplus1000
Copy link
Collaborator

[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants