Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Needing to invert black & white on PDF from local server, not through the Chrome .pdf extension

Community Beginner ,
Jan 22, 2025 Jan 22, 2025

this has some to do with PDF's, and some to do with chrome extensions so i am posting here and will post elsewhere about how to make a chrome extension that will invert the white and black from a .pdf that is pulled from a local server.

 

every single extension ive downloaded so far has not & does not invert the black & white. the only way ive been able to iis to install the adobe extension, open the pdf in chrome and then go to appearance and invert colors there but many of us do not have an adobe subscription so im trying to create a chrome extension that you can toggle on and off that inverts the black & white on a pdf stored locally.

 

can nyone help with this?

TOPICS
PDF , PDF forms
374
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 21, 2025 Mar 21, 2025
LATEST
quote

this has some to do with PDF's, and some to do with chrome extensions so i am posting here and will post elsewhere about how to make a chrome extension that will invert the white and black from a .pdf that is pulled from a local server.

 

every single extension ive downloaded so far has not & does not invert the black & white. the only way ive been able to iis to install the adobe extension, open the pdf in chrome and then go to appearance and invert colors there but many of us do not have an adobe subscription so im trying to create a chrome extension that you can toggle on and off that inverts the black & white on a pdf stored locally.

 

can nyone help with this?


By E-ZPassCT @Marc32648467ooa2

 

Hello,

Creating a Chrome extension to invert black and white in PDFs stored locally is a great idea! Here's a high-level guide to get you started:

Steps to Create the Extension
Set Up the Manifest File:

Create a manifest.json file to define your extension's metadata and permissions. For local PDFs, you'll need the "file://*/*" permission.

Inject a Content Script:

Write a content script in JavaScript that applies a CSS filter to invert colors. For example:

document.body.style.filter = "invert(1)";

Handle Local PDFs:

Use the chrome.fileSystem API to access local files. Ensure your extension has the "fileSystem" permission.

Add a Toggle Button:

Create a browser action (e.g., a button in the toolbar) to enable or disable the inversion. Use chrome.storage to save the toggle state.

Test Your Extension:

Load your extension in Chrome's developer mode and test it with local PDFs.

Challenges and Tips
PDF Rendering: Chrome's built-in PDF viewer might not allow direct manipulation. You may need to use a library like PDF.js to render and manipulate PDFs.

User Permissions: Ensure users enable "Allow access to file URLs" in the extension settings for local files.

 

Hope this helps!

Best regards,
Edna

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines