PSPDFKit add network image into scrollview like pdf page - ios

I'm using PSPDFKit in my app. I want to load remote images async with the framework, cause there are both images and normal files in my app. I have tried convert imageData into PDFDataProvider, which cannot be Asynchronous. Does anyone have ideas?

Author of PSPDFKit here. Please contact us for feature requests directly, we only rarely monitor StackOverflow - that's not the right platform to provide support for commercial products.
That being said, the PSPDFViewController is designed to present PDF files - we don't have immediate plans to add support for other file types.

Related

Rich link preview in flutter

Is it possible to make a preview from an url, grabbing all the information such as title, relevant texts and images. Is there any plugins I can use readily?
See this Native android plugin
You can do this way :
1)Create a user at https://www.linkpreview.net
2)Generate an Access Key.
3)From your code call
http://api.linkpreview.net/?key=<Your_API_KEY_From_Step_2>&q=https://www.google.com
It returns the meta tags in JSON as below :
{"title":"Google","description":"Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.","image":"http:\/\/www.google.com\/images\/branding\/googlelogo\/1x\/googlelogo_white_background_color_272x92dp.png","url":"https:\/\/www.google.com\/"}
4) Use it in flutter widget to create a preview.
Hope I'm not late to answer this question, There is a plugin for link with previews Rich link preview
Currently, there is not an open source library for flutter providing these meta tags for a website.
There is a temporal solution, using these freemium APIs for getting this information. The main drawback is that the requests are limited before paying.
I know I'm a bit late but I found a solution for that.
The comment of Sudip might work but if you have a lot of preview to generate, you will have to subscribe and pay..
I couldn't use the library rich_link_preview because of some depency issues (it requires http < 1.12.0).
So I had to do it myself. Writting the complete answer in this comment would be too long so I'll tell you how I did it.
I followed this youtube tutorial. If you are too lazy to watch the entire video you can look at his Github Repo. It worked for me and it is not too long (there are only 2 relevant files):
lib/link_preview.dart
lib/helper/fetch_preview.dart

How to upload HTML File(contains img,css and js) to Contentful (CMS)?

I have created a sample HTML(contains js, css and images) guide. I want to upload this html file to CMS(content management System) to edit content later. After that I will retrieve html content from CMS System and load it in my iOS app. So my guide will not be static and I don't have to rebuild for my iOS app every time. I reviewed content-ful api service, but can't find a way to upload html file. is this possible ? Please help me on this? or any other ideas?
I think it's not unfortunately possible. In your case it's easier to add content manually to your Contentul space and then retrieve the content within web application using JavaScript SDK. If you're going to create iOS app as well, then Objective-C SDK and Swift SDK might be useful for utilizing the content in future.

How to share a bunch of files at once in iOS

I need to share some data, e.g. two images, to other apps like dropbox or gdrive.
Some recommend using UIActivityViewController but there's no option for mimetypes and other recommend using UIDocumentInteractionController but this seems only be suitable for single files...
Does anybody know about the right way and/or can provide some example in swift?
Edit:
UIActivityViewController seems to be the right way and NSURL.fileURLWithPath(filePath) provides the content.
But what about files stored on a server? Those must be downloaded at some point during share process (e.g. after choosing dropbox). How can I achieve this? I tried with a customized UIActivityItemSource with no luck.
Thanks.
Take a look at the Apple doc for UIPasteboard.
Using UIActivityViewController is the right way.
I had to provide my files wrapped in a subclass of UIActivityItemProvider.
Overriding item()-function for downloading and providing my binary content.

iOS - Is there a way to generate a PDF file with layers?

Quick question, that I haven't found a solid answer yet.
Is it possible to generate a PDF in iOS that includes layers, which can then be removed/separated in Photoshop?
What I'm trying to achieve is take a picture with the camera of the phone, then place text over it, submit it as pdf to a customer and then have the customer read the text and remove it.
I can do everything except the layering of the pdf and I have found some hints that this isn't possible to do with the standard iOS library, but I wanted to know if anyone has come across this before.
Thank you.
The standard iOS API for creating PDF files cannot create layers (optional content) in a PDF page.
This library IFXPDFFactory seems to be able to generate PDF files with layers.
PoDoFo and libHaru can also be used to generate PDF files on iOS but I do not know if they support layers.

Rendering PDF in iOS

Need help on rendering PDF using CGPDFContext. I am currently using UIWebView to display PDF but would like to perform much more operation rather than just reading like Highlight Text, Search PDF, Annotate PDF. Not looking for using any Framework or library.
Any help will be beneficial. For a start, code on how to render PDF using CGPDF and displaying it instead of using UIWebView.
PDF annotations are a rabbit hole. I've been working on them since 2010. The spec is thousands of pages. It's easy to get started but it takes forever to get right with all the PDFs and variations out there. Even a simple feature like bookmarks are harder than you would think.
To date there's no open source framework that implements PDF annotations. The above linked one can be a good starting point. If you don't have months/years to build something on your own, there are a few commercial options available - like PSPDFKit, available for iOS, Android and Web, which I am building.
We have a guide article listing the most important PDF spec documents.
Searching is another tricky topic. It's quite hard to convert the PDF text data to unicode. The Adobe CIDFont spec is a good starting point.
You shoud try VFReader, it is an open source project for rendering PDF files on iOS. It can be a good starting point.

Resources