
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
@klippa/ngx-imageviewer
Advanced tools
Forked from https://github.com/emazv72/ngx-imageviewer
This project generate a image/pdf viewer using canvas.
Access a demo by downloading this project and execute: yarn && yarn start
or npm install && npm run start
to self server it.
You can use any icon font to render the button's icons. However, the default icon font is the Google's Material Icons. To use them you can just add the follow line to your index.html:
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
Optionaly, you can also install the font library via npm or yarn.
when using another icon font, you should provide a config object with the button icon mapping
After import the module ImageViewerModule
:
import { ImageViewerModule } from '@klippa/ngx-imageviewer';
@NgModule({
imports: [ImageViewerModule],
})
export class AppModule {}
Use the follow code on your html:
<ngx-imageviewer [src]="imageSrc"></ngx-imageviewer>
Optionaly, you can provide the fields width
and height
. If you omit those values, the width and height in the config object will be used.
To add PDF rendering support, you must first include pdfjs
by running yarn add pdfjs-dist@2.5.207
and add its reference in your angular.json
file, like below:
{
...
"scripts": [
{
"input": "node_modules/pdfjs-dist/build/pdf.min.js"
}, {
"input": "node_modules/pdfjs-dist/build/pdf.worker.min.js"
}
],
...
}
Optionaly, you can provide a custom configuration like below:
import { IMAGEVIEWER_CONFIG, ImageViewerConfig } from '@klippa/ngx-imageviewer';
...
const MY_IMAGEVIEWER_CONFIG: ImageViewerConfig = {
buttonStyle: {
bgStyle: '#B71C1C' // custom container's background style
}
};
...
@Component({
...
providers: [
{
provide: IMAGEVIEWER_CONFIG,
useValue: MY_IMAGEVIEWER_CONFIG
}
]
...
})
...
The default configuration available is:
export const IMAGEVIEWER_CONFIG_DEFAULT: ImageViewerConfig = {
width: 800, // component default width
height: 600, // component default height
bgStyle: '#ECEFF1', // component background style
scaleStep: 0.1, // zoom scale step (using the zoom in/out buttons)
rotateStepper: false, // touch rotate should rotate only 90 to 90 degrees
loadingMessage: 'Loading...',
buttonStyle: {
iconFontFamily: 'Material Icons', // font used to render the button icons
alpha: 0.5, // buttons' transparence value
hoverAlpha: 0.7, // buttons' transparence value when mouse is over
bgStyle: '#000000', // buttons' background style
iconStyle: '#ffffff', // buttons' icon colors
borderStyle: '#000000', // buttons' border style
borderWidth: 0, // buttons' border width (0 == disabled)
},
tooltips: {
enabled: true, // enable or disable tooltips for buttons
bgStyle: '#000000', // tooltip background style
bgAlpha: 0.5, // tooltip background transparence
textStyle: '#ffffff', // tooltip's text style
textAlpha: 0.9, // tooltip's text transparence
padding: 15, // tooltip padding
radius: 20, // tooltip border radius
},
zoomOutButton: {
// zoomOut button config
icon: 'zoom_out', // icon text
tooltip: 'Zoom out', // button tooltip
sortId: 0, // number used to determine the order of the buttons
show: true, // used to show/hide the button
},
// shorter button configuration style
nextPageButton: createButtonConfig('navigate_next', 'Next page', 0),
beforePageButton: createButtonConfig('navigate_before', 'Previous page', 1),
zoomInButton: createButtonConfig('zoom_in', 'Zoom in', 1),
rotateLeftButton: createButtonConfig('rotate_left', 'Rotate left', 2),
rotateRightButton: createButtonConfig('rotate_right', 'Rotate right', 3),
resetButton: createButtonConfig('autorenew', 'Reset', 4),
};
FAQs
Forked from https://github.com/emazv72/ngx-imageviewer
The npm package @klippa/ngx-imageviewer receives a total of 0 weekly downloads. As such, @klippa/ngx-imageviewer popularity was classified as not popular.
We found that @klippa/ngx-imageviewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.