Looks very cool, also quite close from the backend I made myself with bitcoinJ for the former BTChip shop, so I won't have to clean that up and publish it :)
Two suggestions from the trenches :
I've seen people that split a payment from N different wallets. Not sure it supports it.
Could be nice to make a side library for a totally safe server : encrypt customer credentials locally with OpenPGP.js before sending them to the server, and create the invoice locally with PDF.js so that the customer details never touch the server unencrypted.
I don't know any library that handles .docx. But if you need a PDF viewer you can use https://mozilla.github.io/pdf.js/ (it doesn't allow editing, but it's pretty fine for reading — see the Demo: https://mozilla.github.io/pdf.js/web/viewer.html).
PDF.js does a pretty great job of showing PDFs in the browser, and you'll get a consistent result across all machines.
With the deprecation of NPAPI plugins, you may not be able to rely on any system browser plugin being available.
Test to see if the browser has a built-in PDF renderer.
If it doesn't, you can always try something like PDF.js. They do have a website where you can load your own PDFs, but this needs local filesystem access which the PS4 browser doesn't supply. You'd have to setup a web server on another computer with a page that loads PDF.js and your document(s). Not that hard to do if you know what you're doing (or aren't afraid to follow some basic examples). Then you could read via PSVR to your hearts content.
Extensions cannot inject content scripts into the built-in PDF viewer, as it is treated like an internal page.
There is a web app version of the viewer which you could modify and host somewhere and then load PDFs into that instead. I haven't tried it myself, but the demo is here:
https://mozilla.github.io/pdf.js/web/viewer.html
On the right side of the black toolbar is the open file button to load a PDF into it; that isn't uploaded, it's handled locally.
You may want to just learn how to encode PDFs for web-optimized display. For starters just check "Fast Web View" when creating the PDF and it'll load progressively, and downsample raster graphics to lower PPI.
The next thing I'd recommend is to take a look at Mozilla's PDF.js ... if you use Firefox you're actually already using it, since this is what Firefox uses to display PDFs in the browser. It's pure Javascript, so you can also easily use it to display a PDF from inside a web page.
Both of those are alternatives to converting the PDF to HTML, which you probably already know is going to be problematic if you know anything about host PostScript works. There are libraries to do this, but the results aren't fantastic.
For that I would utilize Mozilla’s pdf.js library. It’s been awhile since I’ve needed to do that. But long ago I did this in a heavily customized vf page. I have yet to try this in a lightning component but I’m sure there is a way to get it done. https://mozilla.github.io/pdf.js/examples/index.html#interactive-examples
There's nothing available for that. You'll have to use something like pdf.js to parse the PDF and extract the CAD model, then write code to convert that model into a format a JS 3D library can use (like Three.js), then render it in a canvas.
You're trying to convert individual pages of a PDF to JPG/PNG not the other way around right?
Otherwise it is supported by this native implementation it seems:
https://github.com/Anyline/react-native-image-to-pdf
What you could do is use a pdf viewer and hide it off screen (position: absolute, left: -10000) then use this puppy to snapshot the view
https://github.com/gre/react-native-view-shot
Just not sure how you make it change pages programatically but it's a sound theoretical solution.
Otherwise you're going to have to go native.
The javascript bridge makes working with images in react native itself a PITA. Even on a fast phone taking a photo then passing that across the bridge into javascript and back into another component can take a couple of seconds and chew up memory big time.
That being said I am not going to recommend this: https://mozilla.github.io/pdf.js/ but it's there if you want to make life hard for yourself :) Combine it with the canvas implementation
Some context to explain what is happening: this is a maintenance manual for a laptop (the Lenovo P50). It uses Scalable Vector Graphics for the drawings.
Whoever did those drawings made them from the bottom up to include every little part of the laptop, and then included all of those layers in the final images, even though 90% of those parts will end up invisible (as a /r/midlyinfuriating side-effect, the PDF is 64 megabytes in size. For comparison: the linked 5 minute screencapture in 1080p60 is only 43 megabytes).
If opened in a fast PDF viewer, you would never notice this - they would detect the parts that are invisible and skip drawing them altogether. However, Firefox uses pdf.js, which doesn't do this. As a result you can see the laptop being built up from scratch as it is drawn.
Using good old google I found PDF.js if you know what your doing then you can implement this into the page see instructions on how to do this, hope it helps, its also available as a wordpress plugin
seems like webview since is embedded in chrome.
another similar project is pdf.js from mozilla:
https://mozilla.github.io/pdf.js/
I used it to display pdfs inside apps in Android with pretty good result
Hi, You can make use of PDF.js, a Javascript Library. There is a sample implementation for android here Android-pdf.js. However, this didnt work well for me when trying to load PDFs with Images. I ended up using an implementation of a Native Viewer MUPDF. A working sample can be found here AndroidPdfViewer. You would have to Download your PDF manually and get it rendered by the Library. Best.
Mozilla offers a free tool to render PDF files on your page. You are supposed to customize it to your look and feel. Works great and is an easy start with something like that:
So you would need a bridge that takes a PDF, extracts the annotation markup and offers it to the Vue.js frontend. Then take the new state of annotations from the Vue.js frontend, convert it back into the given PDF.
A part of this could be done with https://mozilla.github.io/pdf.js/getting_started/ but not all of it.
> Are you saying you know alternative when it comes to displaying pdf?
Sure, adobe acrobat reader. And if you really want to use the browser use pdf-js.
The pdf.js component renders the PDF to an HTML canvas. Perhaps it creates images at a certain DPI for the stated page size and doesn't re-render as you zoom in.
If you load your test PDF into the current web app version at the following URL (there's a File Open button on the viewer toolbar), does the same problem occur?
https://mozilla.github.io/pdf.js/web/viewer.html
If so, you could search for and/or file an issue on Github:
https://github.com/mozilla/pdf.js/issues/
If the problem only occurs after the viewer is baked into Firefox, then you could file a bug in Bugzilla:
Go to about:preferences
-> General category -> Files and applications Section -> Downloads subsection -> Always ask where to save files.
The settings you mention only apply when you try to open a resource and it can't be natively opened with Firefox (image formats get added there just as any other extension of any file you have ever downloaded or tried to open with firefox).
Image actions won't be respected from there, but others like PDF will get respected even if Firefox can open them since they require a dependency that is embeded into Firefox (pdf.js).
Maybe Evince inserts different formatting than Adobe?
You can load your PDF into the latest development version of the viewer over here (there's an Open File button next to the Print button on the viewer's toolbar):
https://mozilla.github.io/pdf.js/web/viewer.html
If the annotations do not show there, either, you could file a new issue and share a copy of a sample PDF:
The most powerful viewer (real PDF viewer) is pdf.js library https://mozilla.github.io/pdf.js/
This plugin utilize the same library. Extremely light and it works https://wordpress.org/plugins/pdfjs-viewer-shortcode/
However you need to test and play around to be able to customize it the way you want. This is the best you will get for free and is extremely robost.
"Find in This Page" is grayed out on the Edit menu for some reason. The web app version of the PDF viewer can find text in that PDF (https://mozilla.github.io/pdf.js/web/viewer.html), so it appears to be something about Firefox's native find feature that has a problem with the document.
You could file a bug: https://bugzilla.mozilla.org/
I am trying to simplify your ask here by a LOT to help me understand. So correct me if I am wrong but it sounds like you want to provide a PDF based on data from a data base.
If thats the case then you can dynamically render the PDF in the browser there are a few popular libraries out there but i have had my eye on this one:
https://mozilla.github.io/pdf.js/
Basically, assuming the data is already in the DB, you would need to request the data in the browser( http/ajax for example) and the use that to render the pdf to display and or make available for download using the above library.
Hope that at least gets you in the right direction.
I've been mucking around with PDF.js (https://mozilla.github.io/pdf.js/). Seems to do the job.
I'm building an app that needs to be able to display png, jpg and pdf. This has so far done what I need.
Are you committed to using LiveView for this particular feature? I don't know of any Elixir specific PDF solutions (and don't see any in the other comments either), but I've had success building PDF viewing functionality using https://mozilla.github.io/pdf.js/ on the client-side.
Da würde ich PDF.js empfehlen. Das kann nicht nur PDFs anzeigen sondern bietet auch Zugriff auf die Inhalte der Dokumente. Ich weiß jetzt nicht genau wie du die Daten extrahierst aber das ließe sich sicher portieren. Sag gerne Bescheid wenn du da noch Fragen zu hast.
Great man, that's awesome! I recommend working on a Mozilla project, PDF.js library, it currently has some typescript types but they are way off.
Here is the link to the project https://mozilla.github.io/pdf.js/
AFAIK, Android's WebView does not natively support displaying PDFs. You probably have to either download the file or resort to a 3rd party library to display it or render PDF to HTML, such as Mozilla's PDF.js
​
Never used vue-pdf, but in the past what i've done was simply embed an iframe using Google's docs viewer.
So using the same example PDF that pdf.js uses( https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf )
All you have to do is create an iframe with a src of: https://docs.google.com/viewer?url=https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf&embedded=true
It's been a while since I've had to do this but I *think* you can use an iframe or object to display the pdf, both have their limitations but will work if you *only* want to *display* the pdf.
​
If you're open to 3rd part tools, I remember pdf.js being pretty good.
Ironically, I know exactly what's causing this as I recently had the same problem when using that same PDF engine in another software project.
The engine uses data:
URLs in order to load embedded fonts from PDFs which have custom fonts in them. These custom fonts are rendered using the Private Use Characters range in Unicode. If the font can't be loaded — because the Content Security Policy is blocking the data:
URLs, for example — then the private use characters will be rendered using whatever font has a glyph at that codepoint, and because it's private use, that varies per font and you get garbage.
PDFs which don't have embedded fonts, but use the ones listed in the PDF standard, aren't affected.
If you hit F12 in Firefox on a PDF, and check the console there and see errors about data URLs being blocked, then that's the issue.
Could you try this one and give me feedback:
https://mozilla.github.io/pdf.js/web/viewer.html
Does it seem as slow?
This is without our local changes so if this one is as slow there's not a ton I can do.
Rendering PDF with web tech is super cool but not amazingly fast on older hardware unfortunately.
Some of the old PDF apps are really optimized for speed as they've been around for a decade.
We're optimized for functionality :)
I wish it was faster of course but maybe in the future.
I’ve just done exactly this scenario for a client, the site’s not live yet so unfortunately I can’t show you.
But I signed him up for a Cloudinary account to host the PDF files, and then used Accentuate to add custom fields to products which I then added the PDF public URLs to. After that, a bit of liquid on the frontend to display the PDF download links.
I went a step further and used PDF.js to actually render a thumbnail of the PDF on the product page.
Does it matter whether the PDF is composed of bits of text and individual images, or contains large scanned images?
You can file images with the pdf.js team here: https://github.com/mozilla/pdf.js/issues
But first, double-check in the current development version -- it's a web app, and you can load a locally saved PDF into it:
It completely depends on the necessities, but you could use an HTML to PDF conversion. I would recommend using browser rendering (pdf.js if you can). I have used fpdf before, but not for PDF forms as of yet. I would recommend using phpmailer to send the PDF form if you needed.
maybe using the web browser + pdf.js? I'm at work so I don't have my vita to test it, but you can test it here:
https://mozilla.github.io/pdf.js/web/viewer.html
Pdf.js it's an open source project from mozilla to render pdfs in (webkit compatible?) browsers.
There really don't seem to be a lot of PDF rendering libraries (AFAICT from briefly looking at their documentation, both PoDoFo and PDFHummus don't seem to have that functionality). Besides Poppler and Xpdf on which it is based, there is MuPDF and Ghostscript (both AGPL). Since you're already using WebKit, you might want to try PDF.js (Apache License 2.0), but that's certainly not the nicest solution.