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

Is this content stream reachable with the API? #26

Open
RamKromberg opened this issue Apr 29, 2022 · 0 comments
Open

Is this content stream reachable with the API? #26

RamKromberg opened this issue Apr 29, 2022 · 0 comments

Comments

@RamKromberg
Copy link

How do I reach the content stream with "/Im0 Do" (0 4 obj) in this example?

I tried:

package main

import (
	"fmt"

	"github.com/ledongthuc/pdf"
)

func main() {
	pdf.DebugOn = true

	f, r, err := pdf.Open("test.pdf")
	defer f.Close()
	if err != nil {
		panic(err)
	}

	page := r.Page(1)
	//fmt.Println(r)
	fmt.Println(page)
	fmt.Println(page.Content())
	return
}

Which outputs this:

{<</Contents 4 0 R /MediaBox [0 0 198.75 235.5] /Parent 1 0 R /Resources <</XObject <</Im0 5 0 R>>>> /Type /Page /pdftk_PageNum 1>>}
{[] []}

So it doesn't seem to work even though the code has token handling for everything you'd expect from a graphic stack content stream.

So, is it a bug or am I missing something obvious?

Thanks.

p.s. the sample came out of img2pdf and was uncompressed with pdftk to make it more convenient to open with a text editor and debug.

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

1 participant