Adaptation of the original PdfViewer app to work as a library (fork of https://github.com/GrapheneOS/PdfViewer)
Go to file
octocorvus bb14ba1a25 bugfix: make text layer position absolute and use CSS transform to al...
...ign it to canvas

Fixes a bug where there was empty space above pdf page, when page
rotation is 90 or 270 degrees.

Testing: open pdf and try all rotations (0, 90, 180 and 270 degrees)
with various zoom levels (especially, max and min zoom levels), and make
sure that text layer is aligned properly to the canvas and there aren't
any unwanted blank spaces. Finally, repeat the same testing procedure
for landscape mode.

To check if text layer is aligned properly on debug builds, toggle text
layer visibility from menu or use chrome dev tools.
2023-04-09 09:32:58 -04:00
.github update GitHub workflow to install npm dependencies 2023-03-24 19:45:49 -04:00
app bugfix: make text layer position absolute and use CSS transform to al... 2023-04-09 09:32:58 -04:00
gradle update Gradle to 8.0.2 2023-03-10 13:40:06 -05:00
.gitignore migrate to pdfjs-dist npm package 2023-03-24 19:45:49 -04:00
build.gradle.kts update Android Gradle plugin to 7.4.2 2023-03-10 13:40:02 -05:00
gradle.properties disable obsolete jetifier 2021-11-21 16:55:27 -05:00
gradlew update Gradle to 8.0.1 2023-02-24 15:37:12 -05:00
gradlew.bat update Gradle to 7.6 2022-12-09 08:48:17 -05:00
LICENSE update copyright notice 2023-02-01 23:37:39 -05:00
package-lock.json update pdf.js to v3.4.120 2023-03-24 19:45:49 -04:00
package.json update pdf.js to v3.4.120 2023-03-24 19:45:49 -04:00
PDFJS_LICENSE initial commit with overhauled / rebranded project 2019-06-27 23:22:08 -04:00
README.md add README based on release notes 2020-05-27 19:11:43 -04:00
settings.gradle.kts use Gradle Kotlin DSL 2021-11-21 15:10:47 -05:00
setup add setup script 2023-03-24 19:46:52 -04:00

Simple Android PDF viewer based on pdf.js and content providers. The app doesn't require any permissions. The PDF stream is fed into the sandboxed WebView without giving it access to content or files. Content-Security-Policy is used to enforce that the JavaScript and styling properties within the WebView are entirely static content from the apk assets. It reuses the hardened Chromium rendering stack while only exposing a tiny subset of the attack surface compared to actual web content. The PDF rendering code itself is memory safe with dynamic code evaluation disabled, and even if an attacker did gain code execution by exploiting the underlying web rendering engine, they're within the Chromium renderer sandbox with no access to the network (unlike a browser), files, or other content.