Is there any way to save a webpage as a pdf document in flutter web view - pdf

I am currently using flutter InAppWebView Plugin. I want to save a web page as a pdf file when the url of the page is given. I have used the printCurrentPage() method of the InAppWebView plugin but it does not return the filepath back to the app after saving the file so that it can be shown in a list view in the app itself. Can anyone help me save the webpage as a pdf and show the saved files as a list view.
I have tried webcontent_converter plugin too but it looses some content of the page like images and icon to include in the pdf file.

Related

Web APIs FileReader() hide download option

I've successfully integrated the FileReader() that renders a file from a BLOB so the user can view and interact with it, however the revised criteria states that the user shouldn't be allowed to download the document now.
The requirement is that the download icon is removed from the FileReader() but I can't seem to find a way of doing this, as it's baked into the actual Web API.
I started to write my own PDF viewer using a basic Vue to PDF package and adding custom controls but this is a bit of a monster and I'd like to avoid a complete re-write to remove one action.
Is there any way of removing the download CTA before it renders the PDF?
More context..
The PDF is rendered in the DOM from a BLOB that's passed via an end point I hook into with Axios. I then readAsDataURL(blob) and finally create the FileReader() result as a URL.createObjectURL(blob) to give me the data that I render as the canvas src to enable the PDF viewer. Unfortunately this can't be a PNG as it needs multi pages. Thee issue is that it's sensitive docs that can only be viewed on the portal, so it's to prevent users from easily downloading (aware they could just print screen).

Ionic 3 view PDF in content view with external URL

The application has to show invoice PDF inside <div> which is currently rendered in Webapp itself.
For example :
The web app already has the PDF generation functionality which generates by clicking on generate_pdf function.
I want to show the same PDF by using the same function which is currently available for the public.
Example URL:
http://URL/index.php/pulic/view/generate_invoice_pdf/Smgr4NX7yiWfu3J6qhdtRzF9lVT0kLs2
I have tried InAppBrowser however, it opens up outside the app just want to show inside the app.
DocumentViewer is not supported since it does not contain .pdf in URL
Anyone who needs the solution
I use fileTranfer to download the file and File to show it on the device.

Is there any way to archive and recover entire page (with entire html, css, img, js, ...) using selenium chromedriver on ubuntu?

I'm looking for a way to archive the entire state of webpage, for the purpose of archiving the webpage.
Actually, what I want to somehow save all rendered results of the page (not as the form of screenshot, but the form of rendered result of DOM element) that we can see on browser, and recover them in local environment without network.
I really don't need to save all the functionalities of the page that interact with other computer. Only the view of the page is needed to be archived.
What I tried to archive youtube.com's home page were,
Using beautiful soup to get immediate html sources
Using python selenium and chromedriver to get dynamically loaded html sources
2 + downloading all referenced .css, .js, and images from links in html codes to local directory.
Pressing ctrl+s on chrome, which downloads html sources and several files. (.js, .css, .jpg, ...)
But all of them did not work correctly.
At first, 4th method seems working, but soon I found out that it downloads initial html source, not a dynamically loaded one.
Is there any known ways to do this kind of stuffs? (archiving currently rendered state of the page)
Thanks in advance.

Embedding a external pdf link to my webpage without uploading the pdf file to server

I have a external link to pdf(http://du.ac.in/du/uploads/Admissions/Cut-off/2016/First/290620161st_Cut_Off_DU_1.pdf). I want to show this pdf on my webpage without uploading this file to my server. Basically i want a pdf view embeded code but with the downloadable link of pdf file.
I'm reporting part of an answer of another question, should work
I recommend checking out PDFObject which is a Javascript library to embed PDFs in HTML files. It handles browser compatibility pretty well and will most likely work on IE8.
In your HTML, you could set up a div to display the PDFs:
<div id="pdfRenderer"></div>
Then, you can have Javascript code to embed a PDF in that div:
var pdf = new PDFObject({
url: "http://du.ac.in/du/uploads/Admissions/Cut-off/2016/First/290620161st_Cut_Off_DU_1.pdf",
id: "pdfRendered",
pdfOpenParams: {
view: "FitH"
}
}).embed("pdfRenderer");

Uploading a file with CKEditor's upload functionality but out of the context of the editor itself

I'm currently using the CKEditor and have it working with image upload and browse functionality. In another area of my application, I want to let the user upload an image to the server, but there is no need for a text area at this point. Is it possible to create a simple link or button that launches the upload functionality from CKEditor without actually plopping the textarea/html editor in the space I want my button?
i.e this would be perfect (with javascript too, of course)
<i class="icon-picture"></i> Upload