ng2-pdfjs-viewer | An angular component for PDFJS and ViewerJS ( Supports | Command Line Interface library
kandi X-RAY | ng2-pdfjs-viewer Summary
kandi X-RAY | ng2-pdfjs-viewer Summary
An angular component for PDFJS and ViewerJS (Supports all versions of angular)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ng2-pdfjs-viewer
ng2-pdfjs-viewer Key Features
ng2-pdfjs-viewer Examples and Code Snippets
Community Discussions
Trending Discussions on ng2-pdfjs-viewer
QUESTION
I'm using ng2-pdfjs-viewer and I can pass a pdf file http url but I can't use interpolation nor passing a variable to pdfSrc option inside html tag for rendering a pdf from a rest service response.
How can I pass a Uint8array or base64 object from component.ts to component.html?
...ANSWER
Answered 2020-Jan-22 at 18:07An example for your case is provided here : https://ng2-pdfjs-viewer.azurewebsites.net/bytearray.
Code extract
your.component.html
QUESTION
Is there any possibility of using ng2-pdfjs-viewer for extracting solely the text of a pdf file, e.g. as a string? I want to extract text and regex it for cutting out certain paragraphs depending on the text inside of them.
Thanks in advance
...ANSWER
Answered 2020-Jan-22 at 18:03ng2-pdfjs-viewer
is an angular wrapper over pdfjs and viewerjs. The capabilities of pdfjs is exposed using an attribute PDFViewerApplication
and PDFViewerApplicationOptions
. If extracting text is feasible using pdfjs, these attributes can be used to call internal functions whic does that.
PS: I authored ng2-pdfjs-viewer
QUESTION
I'm fairly new to working with Base64 encoded string/uint8Array, or Blob. I'm using a pdf viewer library from this repo https://github.com/intbot/ng2-pdfjs-viewer for our Angular 8 webapp. I'm sending a fairly large Base64 string(550KB to the UI(containing 34 pages of text), to be rendered by the pdf viewer.
The main issue is that it is only displaying 19 pages in the viewer. However, when I download the document, using the viewer, it has all the 34 pages (confirmed with Preview app on MacOS). I'm not sure if the issue is with the pdf viewer library or the conversion from Base64 to uint8Array/Blob.
Here is the code in the UI to convert the Base64 string
...ANSWER
Answered 2019-Dec-05 at 17:45This has been resolved. The issue was with the backend API merging the PDFs together. Using Apache PDFBox's pdf merger utility, which accepts input streams and the merged pdf document was successfully rendered by the ng2-pdfjs-viewer library. There was no issue with the above JS code.
QUESTION
I just started using ng2-pdfjs-viewer(https://www.npmjs.com/package/ng2-pdfjs-viewer) and trying to provide a print preview of a pdf document to the user using angular 7. I configured and was able to show the document, but couldn't show the print preview.
Here is the relevant code.
...ANSWER
Answered 2019-May-31 at 20:10Have you tried to add [startPrint]="true"? The documentation says "Start print preview of document. This combined with externalWindow could mimic a print preview functionality just like the one in gmail."
QUESTION
I'm creating a new component in Angular to show PDF file , in order to that ,I used ng2-pdfjs-viewer following these steps in the link "https://www.npmjs.com/package/ng2-pdfjs-viewer" but it's not working. I don't know exactly where the problem. here the html component:
...ANSWER
Answered 2019-May-31 at 16:07As per documentation of ng2-pdfjs-viewer
(https://www.npmjs.com/package/ng2-pdfjs-viewer), [pdfJsFolder]
is used to set path to PDF.JS's web and build folders.
You should use pdfSrc
attribute to set pdf's path. It is mentioned under usage section of documentation
E.g.
The documentation also states that uses Mozilla's PDF.JS behind the scenes.
Irrespective of that, glad you got the issue resolved
QUESTION
I want show PDF in angular app in separate tab, used ng2-pdf-viewer.
Installed npm install ng2-pdf-viewer --save
Am getting below error on ng-serve
ERROR in C:/Users/Kusha/TCSTDM/node_modules/ng2-pdf-viewer/fesm5/ng2-pdf-viewer.js Module not found: Error: Can't resolve '@angular/core' in 'C:\Users\Kusha\TCSTDM\node_modules\ng2-pdf-viewer\fesm5' ERROR in C:/Users/Kusha/TCSTDM/node_modules/pdfjs-dist/build/pdf.js Module not found: Error: Can't resolve 'url' in 'C:\Users\Kusha\TCSTDM\node_modules\pdfjs-dist\build' i 「wdm」: Failed to compile. ERROR in ../../../node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.component.d.ts(4,105): error TS2307: Cannot find module '@angular/core'.
app.module.ts
...ANSWER
Answered 2019-Aug-12 at 13:41Which version of angular and pdf-viewer are you using?
This worked for me:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ng2-pdfjs-viewer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page