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

Add possibility to create new GoPdf struct from existing pdf byte array #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

effeix
Copy link

@effeix effeix commented Dec 9, 2020

It would be nice to have the ability to create a new GoPdf from an existing PDF. It is possible using the Importer, so I added a function NewFromBytes() that wraps the feature and creates a GoPdf instance from any byte array that stores a PDF file, importing the pages one by one.

@effeix
Copy link
Author

effeix commented Dec 16, 2020

Hi @oneplus1000! I've created this PR a few days ago and would like to know if it is an acceptable feature! :)

@oneplus1000
Copy link
Collaborator

because I don't know much about "gofpdi", I would like you to add a go test function (you may add it to the gopdf_test.go Or maybe create a new file). Sorry for my late reply 😢

@effeix
Copy link
Author

effeix commented Dec 19, 2020

Hey, no problem! Sure, I will add a test to the PR, you're a 100% correct!

for i := 1; i < len(pageSizes); i++ {
gp.AddPage()

if i > 1 {
Copy link
Contributor

@akhll akhll Jan 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible that i can be less than zero ?

@hsluoyz
Copy link

hsluoyz commented Jan 16, 2021

Can anyone speed up the PR's review and merge process? Thanks a lot!

@effeix
Copy link
Author

effeix commented Jan 16, 2021

Hi @hsluoyz! @oneplus1000 had asked me to provide a few tests for this feature. I have been quite busy latelly and not able to do it. As soon a I find some free time I'll add them and then we can merge.

@0xfourzerofour
Copy link

has this been added yet?

I would like to load a pdf from s3

@vantaboard
Copy link
Contributor

@oneplus1000 can you close this PR? It looks like it's been abandoned.

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

Successfully merging this pull request may close these issues.

6 participants