Comments (17)
What do you mean by fake worker ?
You may talk about this
PDFJS.workerSrc = 'lib/pdfjs-dist/build/pdf.worker.js';
If it's not defined, it can't work, I tried.
But the PDFPageView way may be not perfect. Now I'm trying to have a dynamic zoom (without reloading pdf), it works, but textLayer disapear with this method.
I opened an issue on pdfjs, PDFJS.PDFViewer may be better. I didn't try yet.
from ng2-pdf-viewer.
@Vi-dot right now it's working with fake worker. I think with PDFJS.disableWorker = true
you can enable fake worker, otherwise you have to specify worker, like you did, by providing path for pdf.worker.js
.
from ng2-pdf-viewer.
Similar to #18
from ng2-pdf-viewer.
i've implemented this in a project, can add as a pr
from ng2-pdf-viewer.
Yes please :) Could you do that ? Or push it on your fork
from ng2-pdf-viewer.
@mmaclach, sure, that would be great!
from ng2-pdf-viewer.
hey guys, i've added a pr with a solution - I'm not certain it will work for every case
from ng2-pdf-viewer.
Hello !
Thanks for your help mmaclach.
But there is a bug. Selected text doesn't fit well the rendered layer.
screenshot
Can we use the text inside the rendered layer ?
In this demo of pdf.js, you can select text.
from ng2-pdf-viewer.
I succeed using pdf_viewer part of pdfjs.
Here is a screenshot
I'm going to clean my fork and make a pull request.
Using this pdf_viewer part is going to help for others issues (like hyperlinks, dynamic zoom..).
We also have to make our fork of @types/pdf.
from ng2-pdf-viewer.
hey @Vi-dot - I am using a slightly different configuration in my project so the styling may be slightly off. I think @VadimDez is fixing it in master
from ng2-pdf-viewer.
Ok mmaclach,
I guess you took time to achieve that,
But, do you don't think that ? > it's better to use what it's already in pdfjs
It's also better for element accessing in debug mode, because I don't have canvas any more.
from ng2-pdf-viewer.
Maybe you're misunderstanding me, this is from pdfjs, using the textContent() from the page and creating svg:text objects. If you wanted to you could create html instead. However I think for some pdf documents the text content may not exist
from ng2-pdf-viewer.
Hello,
@mmaclach I understood clearly your way. But it's still not perfect, in the example, selection fits not well text.
In fact, from pdfjs you only get raw text. Integration and style are not from pdfjs.
@VadimDez Using PDFPageView solves this and may solve other issues (dynamic update viewport - usefull for big pdf, hyperlinks)
I made a try on this branch. If you like I can make a pull request.
from ng2-pdf-viewer.
@mmaclach @VadimDez
I put a demo online to show you : https://vi-dot.github.io/ng2-pdf-viewer/
from ng2-pdf-viewer.
@Vi-dot Looks great! Is there any way to get it work with fake worker? Would simplify integration.
Thanks a lot, make a PR, so that i can merge it.
from ng2-pdf-viewer.
looks good, I wasn't aware of PDFPageView
from ng2-pdf-viewer.
- How to select and copy a text after converted into canvas?. Already tried this '[render-text]="true"'
- How to avoid right side and bottom gets trim?
Help me out of this. Thanks in advance. @VadimDez @mmaclach @Vi-dot
from ng2-pdf-viewer.
Related Issues (20)
- pef(Listeners): not removed
- Appending Date and Time with author name in annotation yellow text popup
- Any plans to upgrade to latest pdf.js version HOT 1
- Large file not shows starting pages quickly, is there any way to control chunk requests' sequence for linearization?
- How to get total page count of PDF? HOT 1
- CSP unsafe-inline directive blocks pdf viewer
- Not rendering PDF in angular 17, ng2-pdf-viewer : v10.0.0 HOT 1
- Perticular renge load like pages 5-12 only
- Can't show pdf error ERR_CERT_DATE_INVALID HOT 3
- Thumbnail View I have shown up but scroll issue happned
- Range requests / partial responses do not work in chrome
- Anchor-link in PDF file.
- PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF HOT 9
- ng-pdf-viewer showing black screen HOT 2
- How I can acess RenderParameters from pdf.js
- Update pdfjs-dist to 4.2.67 or later HOT 9
- TS2304: Cannot find name 'WeakKey'. HOT 7
- scrollPageIntoView: "1" is not a valid pageNumber parameter.
- Whats the recommended version to use with angular 15 ?
- (page-rendered)="pdfPageRendered2($event)" event is not working as expected with angular 16.2.12 & ng2-pdf-viewer v^9.1.5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-pdf-viewer.