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

saveHtmlAsPdf handles Images #4

Open
Sun3 opened this issue Mar 30, 2014 · 6 comments
Open

saveHtmlAsPdf handles Images #4

Sun3 opened this issue Mar 30, 2014 · 6 comments

Comments

@Sun3
Copy link

Sun3 commented Mar 30, 2014

I have html code which also includes an images, would the saveHtmlAsPdf handle the image and is there anything special that I would need to do to pass the image info?

Thanks for this lib.

@cliftonlabrum
Copy link

I'm trying to do this as well. Did you ever figure it out?

@jarrodglasgow
Copy link

I need to do this also. Any update?

@cliftonlabrum
Copy link

I haven't heard anything on this, sorry.

In my case, I needed some icons in my PDF, so I ended up rendering them with SVG instead of using an image. Seems to work well.

@jarrodglasgow
Copy link

I found a nice solution. I temporarily stash the UIImage in the app's Documents folder and store the path. Then I just add an tag with that path.

Works like a champ.

@arnold-maderthaner
Copy link

I also have the issue that I need to provide an image into the PDF (f.e. icon.png) but I don' t know how to reference it in the html tag. Could someone provide an example how to best do that ?

@arnold-maderthaner
Copy link

I fixed the issue by setting the baseURL correctly to the documents folder like this:

NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSURL *baseURL = [NSURL fileURLWithPath:path];
self.htmlPdfKit.baseUrl = baseURL;

now I can reference with in my html and it will pick it up from the Documents/images/icon.png file.

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

4 participants