- [#457] - fix: allow pdfjs typings peer dependency v2
- [#408] - Regression: Version 5.2 Broke (page-rendered)
- [#420] - PR for Issue 408
- [#402] - Page is not working
- [#371] - Cannot read property 'version' of undefined when rendering on the server
- [#393] - Fix for broken search functionality when showPage=false
- [#375] - Search and highlight not working when [show-all]="false" [page]="4"
- [#314] - Search functionality not working if i set show all false.
- [#293] - Highlight on single page load
- [#390] - enable setting render text mode to enchanced
You can now set text rendering mode to RenderTextMode.DISABLED, RenderTextMode.ENABLED or RenderTextMode.ENHANCED
[render-text-mode]="1"
- [#366] - add text-layer-rendered event emitter
- [#311] - Update pdfjs
- [#308] - Not working on IOS on both Chrome and Safari
- [#302] - ng2-pdf-viewer dependencies have conflicts with webpack >= 3
PDFJS is not attached to the window
therefore setting custom path to the worker changed to window.pdfWorkerSrc
:
(<any>window).pdfWorkerSrc = '/pdf.worker.js';
- [#281] - Fix error on resize during loading of pdf
pdfFindController
is now public, that means you can now execute a search on the pdf.
In your component's ts file:
- Add reference to
pdf-viewer
, - then when needed execute search()
@ViewChild(PdfViewerComponent) private pdfComponent: PdfViewerComponent;
search(stringToSearch: string) {
this.pdfComponent.pdfFindController.executeCommand('find', {
caseSensitive: false, findPrevious: undefined, highlightAll: true, phraseSearch: true, query: stringToSearch
});
}
- [#274] - Page two way data binding. Do not reset page to 1.
- [#265] - adding after-render-complete emitter
- [#81] - Add a rendered event in promise
Page rendered event is added, use (page-rendered)=callback($event)
Location of bundles is changed.
Therefor SYSTEMJS
config is now updated to:
var map = {
'ng2-pdf-viewer': 'node_modules/ng2-pdf-viewer/bundles',
'pdfjs-dist': 'node_modules/pdfjs-dist'
}
and then add to packages
var packages = {
'ng2-pdf-viewer': { defaultExtension: 'js' },
'pdfjs-dist': { defaultExtension: 'js' }
}
Now both pdfViewer
and pdfLinkService
are public.
You can now scroll to a page from code:
// define view child
@ViewChild(PdfViewerComponent) private pdfComponent: PdfViewerComponent;
// ...
scrollToPage(page: number) {
this.pdfComponent.pdfViewer.scrollPageIntoView({
pageNumber: page
});
}
- [#200] - PDFDocumentProxy, PDFProgressData are undefined for compiler
Now you can import types where you need them directly from 'ng2-pdf-viewer' package:
import { PDFDocumentProxy, PDFProgressData } from 'ng2-pdf-viewer';
- [#238] - added @types/pdf as peer dependency
- [#162] - Worker Source
- [#232] - Don't overwrite PDFJS.workerSrc if already set
- [#226] - Update Size scale Error
- [#237] - Prevent throwing error: "PDFViewer._setScale: '0' is an unknown zoom value"
- [#182] - Documentation: Load preview for local files
In your code update path
to the worker to be /pdf.worker.js
(<any>window).PDFJS.workerSrc = '/pdf.worker.js';
This should be set before pdf-viewer
component is rendered.
- [#168] - Dependency to a prebuilt-version of pdf.js (pdfjs-dist)
- [#195] - progressData.total is undefined
- [#222] - [render-text]="false" is not working
- [#173] - SSR support
- [#194] - Fit original document into the viewport.
- [#206] - Updated Readme for new [fit-to-page] option.
- [#196] - ng2-pdf-viewer breaks the AOT build with Angular CLI 1.5.0
- [#187] - ng build fails when AOT is enabled
Now ng2-pdf-viewer
exports Module
instead of Component
. That means you have to import PdfViewerModule
instead of PdfViewerComponent
.
import { PdfViewerModule } from 'ng2-pdf-viewer';
@NgModule({
imports: [PdfViewerModule]
})
export class YourModule() {}
- [#174] - 2.0.1 no more scrollbar while zooming
- [#36] - Render text layer, hyperlinks, progressive loading, etc.
- [#18] - Is it possible to enable hyperlinks in the rendered PDF?
- [#165] - pdf.js and pdf.worker.js using different versions
- [#50] - Default Rotation
- [#164] - Doesn't load blob url with 1.2.7
- [#160] - some pdf showing in invert color
- [#156] - Chrome error: Invalid SVG dimensions when 'original-size' = false
- [#154] - Multiple display issues on Safari (iOS+Desktop)
- [#147] - GET http://localhost:4200/nullUniGB-UCS2-H 404 (Not Found)
- [#145] - Issue since update from 1.1.1 to 1.2.1 and not fixed in 1.2.2
- [#144] - pdf annotation not shown in svg format
- [#142] - Error: svg:path attribute d: Expected moveto path command ('M' or 'm'), "L 2318.47 6033.1β¦".
- [#141] - Mirror/Upside Down document display
- [#139] - PDF from pdfmake not loading
- [#134] - PDF not loading. Shows black color
- [#108] - PDF is loading as plain text as well as PDF, overlapping
- [#92] - Performance error
- [#80] - One by one page
Updated dependencies
- [#140] - Incorrect Font and Font Size Rendering
- [#151] - force inline style to prevent css override font-family and font-size
- Update dist
- [#150] - Used not minified version of pdfjs
- [#146] - Load web worker separately, use minified version of pdfjs
- [#94] - Add load progress callback
- [#130] - ng build --prod fails for AOT
- [#98] - PDF Auto Resize
- [#124] - PDF background disappeared after update to 1.1.4
- Switched canvas to SVG rendering.
- Changed text layer rendering.
- [#89] - Added
data-page-number
attribute
- [#46] - Retina display support
- [#112] - Error handling
- Updated documentation
- [#111] - out of order
- [#72] - Updated for Angular 4
- [#54] - [show-all] is showing first two page only.
- [#48] - Use ngOnchanges() instead of update() inside setters
- [#47] - Use @Output for after load events
Use (after-load-complete)="afterLoadComplete($event)
instead of [after-load-complete]="afterLoadComplete($event)
on <pdf-viewer>
.
You do not need to bind your callback anymore.
Example of afterLoadComplete
callback:
afterLoadComplete(pdf: PDFDocumentProxy) {
this.pdf = pdf;
}
- [#39] - background-color css causes PDF text to become invisible.
- [#43] - PDF is drawn behind the container
- [#37] - Fix the case where src is still not having a value
- [#35] - New release causing blank pdf
- [#29] - Make text selectable
- [#27] - Added support for rotating
- [#25] - Renamed "on-load-complete" to "after-load-complete"
- [#26] - Re-added pdfjs as dependency
Re-installing of package may be required.
- [#20] - Unable to declare in App Module
- Systemjs integration was changed, now you need to link
dist/index.js
file. See [SYSTEMJS.md] - Support for AoT
- [#22] - Support zoom
- other minor changes
- [#7] - Return pdf info
- [#10] - Need to Pass cookies with request for document src
- [#11] - Update to Angular RC6
- [#12] - Update how-to documentation to RC6
- Removed version lock from peer dependency
- [#6] - Limit [page]
- Updated dependencies
- Minor changes
- #2 - Added webpack compatibility
- Changed default value for original size flag
- Added option to show one or all pdf pages altogether
- Updated dependency pdfjs-dist
- Updated peer dependency
- Added simple typings file