{"id":38841779,"url":"https://github.com/NiranjanKushwaha/imgPdfViewer_library_Angular","last_synced_at":"2026-01-25T13:00:28.143Z","repository":{"id":57686823,"uuid":"471969918","full_name":"NiranjanKushwaha/imgPdfViewer_library_Angular","owner":"NiranjanKushwaha","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-13T03:20:32.000Z","size":296,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-13T06:46:01.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NiranjanKushwaha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-20T12:14:37.000Z","updated_at":"2024-06-13T12:02:20.000Z","dependencies_parsed_at":"2022-09-14T07:10:26.017Z","dependency_job_id":null,"html_url":"https://github.com/NiranjanKushwaha/imgPdfViewer_library_Angular","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NiranjanKushwaha/imgPdfViewer_library_Angular","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiranjanKushwaha%2FimgPdfViewer_library_Angular","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiranjanKushwaha%2FimgPdfViewer_library_Angular/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiranjanKushwaha%2FimgPdfViewer_library_Angular/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiranjanKushwaha%2FimgPdfViewer_library_Angular/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NiranjanKushwaha","download_url":"https://codeload.github.com/NiranjanKushwaha/imgPdfViewer_library_Angular/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiranjanKushwaha%2FimgPdfViewer_library_Angular/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28753411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T14:00:29.596Z","updated_at":"2026-01-25T13:00:28.125Z","avatar_url":"https://github.com/NiranjanKushwaha.png","language":"TypeScript","funding_links":[],"categories":["Third Party Components"],"sub_categories":["PDF"],"readme":"# Angular Image \u0026 PDF Viewer\n\n[![npm version](https://img.shields.io/npm/v/img-pdf-viewer.svg)](https://www.npmjs.com/package/img-pdf-viewer)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://img.shields.io/npm/dm/img-pdf-viewer.svg)](https://www.npmjs.com/package/img-pdf-viewer)\n[![StackBlitz](https://img.shields.io/badge/StackBlitz-Live%20Demo-orange.svg)](https://stackblitz.com/edit/img-pdf-viewer)\n\nA **premium, highly customizable Angular library** for viewing PDF documents and images. Built with performance in mind using Mozilla's `pdf.js` engine, it offers a seamless \"Google Drive-like\" preview experience for your Angular applications.\n\n---\n\n## ✨ Features at a Glance\n\n| Feature            | Description                                                                   |\n| :----------------- | :---------------------------------------------------------------------------- |\n| **📄 Dual Mode**   | Smartly switches between **PDF** and **Image** viewing (PNG, JPG, WEBP, SVG). |\n| **🔍 Smart Zoom**  | Mouse-wheel zoom, pinch-to-zoom, and preset zoom levels (50% - 300%).         |\n| **🔄 Rotation**    | Rotate documents 90° clockwise or counter-clockwise on the fly.               |\n| **🛠️ Smart Proxy** | Industrial-grade strategy: direct access first, then \"smart\" proxy fallback.  |\n| **🧩 Heuristics**  | Detects doc types without extensions by analyzing URL path patterns.          |\n| **📱 Responsive**  | Logic that adapts to any screen size, mobile or desktop.                      |\n| **🖥️ Fullscreen**  | Native immersive mode for distraction-free reading.                           |\n\n---\n\n## 📦 Installation\n\nInstall the library and its peer dependencies:\n\n```bash\nnpm install img-pdf-viewer\n```\n\n---\n\n## 🚀 Quick Start Guide\n\n[![StackBlitz](https://img.shields.io/badge/StackBlitz-Live%20Demo-orange.svg)](https://stackblitz.com/edit/img-pdf-viewer)\n\nFollow these 4 simple steps to integrate the viewer into your app.\n\n### 1️⃣ Import the Module\n\nIn your `app.module.ts`:\n\n```typescript\nimport { ImgPdfViewerModule } from \"img-pdf-viewer\";\n\n@NgModule({\n  imports: [\n    ImgPdfViewerModule,\n    // ...\n  ],\n})\nexport class AppModule {}\n```\n\n### 2️⃣ Define Configuration\n\nIn your component (e.g., `app.component.ts`), set up the document URL and optional config:\n\n```typescript\nimport { DocumentViewerConfig } from \"img-pdf-viewer\";\n\nexport class AppComponent {\n  // Your PDF or Image URL (can be from an API or local asset)\n  docUrl = \"https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf\";\n\n  // Customize the look and feel\n  config: DocumentViewerConfig = {\n    showToolbar: true,\n    showZoom: true,\n    showRotation: true,\n    showDownload: true,\n    showFullscreen: true,\n    initialZoom: 100,\n    viewMode: \"single\", // Options: 'single' | 'continuous'\n  };\n}\n```\n\n### 3️⃣ Add to Template\n\nIn your HTML (`app.component.html`), drop in the component:\n\n```html\n\u003cdiv class=\"viewer-host\"\u003e\n  \u003cngx-imgPdf-viewer [documentUrl]=\"docUrl\" [config]=\"config\" [title]=\"'Project Documentation'\"\u003e \u003c/ngx-imgPdf-viewer\u003e\n\u003c/div\u003e\n```\n\n### 4️⃣ Set Container Height\n\n\u003e [!WARNING]\n\u003e The viewer takes the height of its parent. If the parent has `0px` height, the viewer will be invisible!\n\nIn `app.component.css`:\n\n```css\n.viewer-host {\n  height: 100vh; /* Make it full screen */\n  width: 100%;\n  border: 1px solid #ddd; /* Optional: adds a nice border */\n}\n```\n\n---\n\n## 🛠️ Advanced Configuration\n\nThe `DocumentViewerConfig` interface allows you to granularly control the UI:\n\n| Property         | Type                       | Default     | Description                                                         |\n| :--------------- | :------------------------- | :---------- | :------------------------------------------------------------------ |\n| `showToolbar`    | `boolean`                  | `true`      | Show or hide the top toolbar.                                       |\n| `showZoom`       | `boolean`                  | `true`      | Enable zoom-in and zoom-out buttons.                                |\n| `showRotation`   | `boolean`                  | `true`      | Enable rotation controls.                                           |\n| `showDownload`   | `boolean`                  | `true`      | Allow users to download the source file.                            |\n| `showFullscreen` | `boolean`                  | `true`      | Enable the fullscreen toggle button.                                |\n| `viewMode`       | `'single' \\| 'continuous'` | `'single'`  | **Single**: Page-by-page. **Continuous**: Scroll through all pages. |\n| `initialZoom`    | `number`                   | `100`       | Start percentage for zoom.                                          |\n| `proxyUrl`       | `string`                   | `undefined` | Custom proxy to bypass CORS (e.g., `https://corsproxy.io/?`).       |\n| `fallbackType`   | `'pdf' \\| 'image'`         | `undefined` | Type to use if auto-detection fails for extensionless URLs.         |\n| `height`         | `string`                   | `'100vh'`   | Height of the viewer container.                                     |\n\n---\n\n## 🤝 Contribution\n\nWe love open source! If you'd like to contribute:\n\n1.  Fork the repo.\n2.  Create a branch (`git checkout -b feature/amazing-feature`).\n3.  Commit your changes.\n4.  Open a Pull Request.\n\n## 📄 License\n\nThis project is licensed under the **MIT License** - see the LICENSE file for details.\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ by \u003ca href=\"https://github.com/NiranjanKushwaha\"\u003eNiranjan Kushwaha\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNiranjanKushwaha%2FimgPdfViewer_library_Angular","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNiranjanKushwaha%2FimgPdfViewer_library_Angular","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNiranjanKushwaha%2FimgPdfViewer_library_Angular/lists"}