Commit Graph

40 Commits

Author SHA1 Message Date
Matéo Duparc 476f4aa685
libpdfviewer: update to PdfViewer 17 2023-09-08 19:47:30 +02:00
Hanouta 0060e2cb73 set zoomRatio to fit document to screen size 2023-07-03 19:21:29 -04:00
octocorvus 6f40b25b31 add eslint config and missing semicolons 2023-06-09 11:33:53 -04:00
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
octocorvus ae1c0874ce add option to toggle text layer visibility on debug builds
This is to ease debugging text layer on debug builds.
2023-03-24 19:45:49 -04:00
octocorvus d445c48f3c code style changes
- js: use double quotes consistently
- js: use strict equality operator everywhere
- js: end all statements with semi colon
- css: remove redundant unit of measures
2023-03-24 19:45:49 -04:00
octocorvus 69696ae2a9 use CSS transform to rotate text layer
Newer pdf.js versions don't automatically rotate text layer based on
viewport's rotation, instead they now set the value of the attribute
"data-main-rotation" to value of rotation in degrees. So, we now apply
CSS transformation to the text layer depending on the value of that
attribute.
2023-03-24 19:45:49 -04:00
octocorvus 2dea11799c use --scale-factor variable to set text layer font size
Newer pdf.js versions requires this variable to be set equal to the
actual scale (zoom ratio), to properly set font size in text layer div.
2023-03-24 19:45:49 -04:00
octocorvus f5a1452a2d migrate away from deprecated APIs
- renderTextLayer: use textContentSource parameter instead of textContentStream
- renderTextLayer: pass a div for the container argument
2023-03-24 19:45:49 -04:00
octocorvus 2935bd4b27 migrate to pdfjs-dist npm package 2023-03-24 19:45:49 -04:00
Matéo Duparc 6e8fdb56a5
libpdfviewer: update to PdfViewer 16 2023-02-01 22:52:07 +01:00
loryeam 1cf1c7ec28 horizontally and vertically center canvas and text layer
Also fixes an issue where text layer is not exactly on top of the canvas when
canvas width is less than screen width (which happens often in landscape mode or
when fully zoomed out)
2022-12-05 03:20:08 -05:00
Matéo Duparc 2766000ebc
libpdfviewer: update to PdfViewer 15 2022-10-06 18:22:57 +02:00
loryeam fbd6c45c3f fix a typo in viewer.js which can cause cache miss 2022-10-04 12:23:18 -04:00
Matéo Duparc 06e54dbb03
libpdfviewer: update to PdfViewer 14 2022-09-20 16:00:48 +02:00
Pratyush 68fc48d3a9 add on (doc) loaded callback 2022-09-12 02:08:42 -04:00
Pratyush 87c71ddac2 added support for encrypted PDF
based on https://github.com/GrapheneOS/PdfViewer/pull/17

Signed-off-by: Pratyush <codelab@pratyush.dev>
Co-authored-by: Tommy-Geenexus <tomgapplicationsdevelopment@gmail.com>
Co-authored-by: empratyush <codelab@pratyush.dev>
2022-05-06 10:07:59 -04:00
Matéo Duparc 0f312347dd
libpdfviewer: update to PdfViewer 12 2022-03-06 21:39:38 +01:00
MHShetty c7a0ae858e Use a grey background while viewing a document 2022-02-19 08:48:09 -05:00
smdyv f07b6350df Center canvas 2022-02-19 08:37:38 -05:00
smdyv c743c0d6a7 Create layout for the PDF viewer activity
Updating insets is no longer necessary because the layout reserves the
space for the top app bar and frees it up in full-screen mode so the
WebView can fill the entire screen.
2022-02-19 08:32:15 -05:00
Matéo Duparc 4e4b7c5da4
libpdfviewer: Genesis 2022-02-18 15:03:53 +01:00
June 9596bcf082 add pdfjs-dist submodule and symlink minified files
This should make the update process of pdf.js far easier and more maintainable as we can just use the pdfjs-dist tags

Signed-off-by: June <june@eridan.me>
2022-01-22 22:12:31 -05:00
Daniel Micay e4b107e1e4 update text layer CSS 2021-11-24 22:22:33 -05:00
Daniel Micay 1c69280219 update pdf.js to 2.10.377 2021-11-21 17:30:18 -05:00
Daniel Micay 0d08f3606d explicitly set pdf.js worker to avoid deprecation 2021-11-21 15:40:04 -05:00
anupritaisno1 9547b55a9a update pdf.js to 2.5.207 release
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
2020-11-10 18:20:55 -05:00
anupritaisno1 64407e3a85 update pdf.js to 2.4.456
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
2020-06-01 15:49:46 -04:00
Daniel Micay f780734c9c use CSS zooming until end of zoom gesture 2020-04-04 12:15:29 -04:00
Daniel Micay 371cb3efdc fix error made during migration to zoom ratio 2020-04-04 11:34:12 -04:00
Daniel Micay e98398749e rename lazy to zoom and check it for scrollTo 2020-04-04 11:31:16 -04:00
Antoine d'Aligny e509660d7e Preparation for ratio zoom 2020-04-04 11:20:42 -04:00
Daniel Micay 1da56e759f set fullscreen padding to the proper width 2019-08-20 12:47:01 -04:00
Daniel Micay be2439be65 add padding to account for fullscreen mode 2019-08-20 12:40:12 -04:00
Tom G 5fc3f790a6 add immersive mode 2019-08-16 19:42:51 -04:00
Daniel Micay f6a4767d37 update pdf.js to 2.1.166 2019-08-16 01:21:12 -04:00
Daniel Micay f5abc23800 replace != and == with !== and === 2019-07-01 01:56:54 -04:00
Daniel Micay 724474a703 remove unnecessary and legacy Firefox workaround 2019-07-01 01:49:24 -04:00
Tommy-Geenexus 4ba712409a Add rotate document option 2019-06-30 02:31:29 -04:00
Daniel Micay d7eed01e80 initial commit with overhauled / rebranded project 2019-06-27 23:22:08 -04:00