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

problem to import two pdf files' page #34

Closed
ghiewa opened this issue May 26, 2020 · 3 comments
Closed

problem to import two pdf files' page #34

ghiewa opened this issue May 26, 2020 · 3 comments

Comments

@ghiewa
Copy link

ghiewa commented May 26, 2020

per check it is imported only one pdf files' page. is it a bug?

`
var tp_i_page int
var flag_i_page int
var tp_page int
var flag_page int
for ....... {
// FLAGxxx, like FLAG018 FLAG2
if strings.HasPrefix(_fi, "FLAG") {
fg, _ := strconv.Atoi(strings.Replace(_fi, "FLAG", "", -1))

				if flag_fil != "" && fg != flag_i_page {
					flag_i_page = fg
					flag_page = pdf.ImportPage(flag_fil, flag_i_page, "/MediaBox")
					pdf.UseImportedTemplate(flag_page, PT_(_sz[0]), PT_(_sz[1]), 0, 0)
				}
				continue
			}

			// PAGExxx, like  PAGE18   PAGE2
			if strings.HasPrefix(_fi, "PAGE") {
				pg, _ := strconv.Atoi(strings.Replace(_fi, "PAGE", "", -1))
				if pg != tp_i_page {
					tp_i_page = pg
					tp_page = pdf.ImportPage(fil, tp_i_page, "/MediaBox")
					log.Println(tp_page, "PAGE")
				}
			}

			pdf.UseImportedTemplate(tp_page, PT_(_sz[0]), PT_(_sz[1]), 0, 0)
		}

`

@ghiewa ghiewa closed this as completed May 26, 2020
@ghiewa
Copy link
Author

ghiewa commented May 26, 2020

find similar problem. LINK

@wdrai
Copy link

wdrai commented May 27, 2020

I think you should not use pdf.UseImportedTemplate but gofpdi.UseImportedTemplate(pdf, ...)

@ghiewa
Copy link
Author

ghiewa commented Jun 1, 2020

I think you should not use pdf.UseImportedTemplate but gofpdi.UseImportedTemplate(pdf, ...)

I used gofpdi in gopdf

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

2 participants