Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - PDF generation issue in Mozilla Firefox #11

Open
al1abb opened this issue Oct 16, 2023 · 9 comments
Open

[BUG] - PDF generation issue in Mozilla Firefox #11

al1abb opened this issue Oct 16, 2023 · 9 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@al1abb
Copy link
Owner

al1abb commented Oct 16, 2023

Description

Note

These issues also arise in the deployed version of the app

Issues:

  1. Direct Download: After generating a PDF, the file is downloaded directly without proper user interaction.

  2. Empty PDF iframe: The PDF iframe appears to be empty, causing difficulties in rendering or displaying the generated PDF.

  3. Opening in New Tab: Opening the PDF in a new tab does not work as expected; it may not load or display correctly.

  4. Quantity Input Error: The quantity input field can accept non-numeric values even though it is specified as type=number.

  5. Signature Drawing: The signature drawing on canvas feels slower and lags behind the mouse (this issue comes from shadcn dialog element).

Expected Behavior:

  • PDF should not be downloaded right after generation. Iframe content should be visible.
  • PDF should be shown in a new tab when opened in a new tab.
  • Quantity and some other numeric input fields should only accept numbers.
  • Signature drawing should be smooth with no lag

Environment:

  • Browser: Mozilla Firefox 118.0.2
  • Operating System: Windows 11 Home
@al1abb al1abb added bug Something isn't working good first issue Good for newcomers labels Oct 16, 2023
@al1abb al1abb changed the title PDF generation issue in Mozilla Firefox [BUG] PDF generation issue in Mozilla Firefox Oct 24, 2023
@al1abb al1abb changed the title [BUG] PDF generation issue in Mozilla Firefox [BUG] - PDF generation issue in Mozilla Firefox Nov 21, 2023
@kishaningithub
Copy link

Any pupeteer alternatives that can fix this natively?

@al1abb
Copy link
Owner Author

al1abb commented May 17, 2024

Any pupeteer alternatives that can fix this natively?

Don't know

@kishaningithub
Copy link

I have used the following in the past

https://github.com/diegomura/react-pdf

It has a declarative way to generate PDF within the browser itself..

@al1abb
Copy link
Owner Author

al1abb commented May 17, 2024

I have used the following in the past

https://github.com/diegomura/react-pdf

It has a declarative way to generate PDF within the browser itself..

I know about it. Tried using it in the past, but had issues configuring it with next.js.
Then I decided to use puppeteer instead

@kishaningithub
Copy link

Oh okie.. then can https://github.com/foliojs/pdfkit be directly used?

@al1abb
Copy link
Owner Author

al1abb commented May 17, 2024

Oh okie.. then can https://github.com/foliojs/pdfkit be directly used?

Not sure

@Qodestackr
Copy link

This is a great project but just having issues extracting it to fit my context. Thanks tho

@Faizanahmedsy
Copy link

It is not working on other broweser too

@AdrianoSmiith
Copy link

Check PDF settings in Firefox
Firefox has a built-in PDF viewer that may be configured incorrectly. To adjust it:
Open Firefox and click the menu (three lines in the upper right corner).
Go to "Settings" (or "Preferences", depending on your operating system).
Scroll down to the "General" section and look for "Applications" or "Files and Applications".
Find "Portable Document Format (PDF)" in the list.
See what the default action is. If it's set to "Save file" and you want to view it in the browser, change it to "View in Firefox". If it's already set to "Always ask" and it doesn't work, try "Always ask" to test.
Try troubleshooting mode
Extensions or settings that you've changed may be interfering. To check:
Click the menu and select "Help".
Choose "Troubleshooting mode" and click "Restart".
Test generating or viewing the PDF again. If it works, an extension may be the culprit. Disable them one by one to identify the problem.
Clear the cache
A corrupted cache can cause crashes:
In the menu, go to "Settings" > "Privacy and Security".
Scroll down to "Cookies and site data" and click "Clear data".
Check "Cache" and confirm. Restart the browser and try again.
Update Firefox
An outdated version may have known bugs:
In the menu, click "Help" > "About Firefox".
If updates are available, the browser will download them automatically. Restart after updating.
Test with another PDF viewer
If the built-in viewer fails, configure Firefox to use an external program (such as Adobe Reader):
In the "Applications" settings, change the PDF action to "Use another application" and select your preferred reader.
Reinstall Firefox (if necessary)
If all else fails, reinstalling Firefox may fix corrupted files:
Uninstall Firefox from the Control Panel (Windows) or by dragging it to the Trash (Mac).
Download the latest version from mozilla.org and reinstall it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants