safari 14.1.2 - can not print a pdf use printjs - safari

I try to use PrintJs and print a PDF file in safari(14.1.2), but when I preview the print file in dialog, I got a empty page. help me!

Related

MVC print PDF without displaying in view with print dialog

I have an MVC app where the intention is for the the user to click Print, and in the subsequent print dialog, verify the target printer, number of copies, etc, and click Print. I'm rendering the PDF document and returning the document thusly:
return File(printJob.Bytes, "application/pdf");
This displays the document quite nicely in the browser. In both Chrome and Edge, when the user clicks Print, they get a preview of the page in the print dialog. So the user experience is they click Print, see a preview, click print, see a preview again and then click print. Does anyone know if it's possible to render the PDF document without displaying it in the browser and instead just present the user with the print dialog box?
Thx in advance!
When you return the PDF from your website, the browser is then acting as a PDF viewer instead of a web browser, so you need to get the PDF to request the print dialog on open, not the website.
You can achieve this by adding the document javascript this.print(true) into the PDF that you are generating.
You can test this in Adobe Acrobat by going to Javascript -> Edit All Javascripts and just pasting this.print(true) at the top outside of any named function.
Tested and working on Chrome, as soon as you open the PDF it displays the print dialog.
Acrobat Javascript Reference is here, the reference to the print function is on page 179.

how to print a pdf using microsoft print to pdf

I do not understand how to use the microsoft print to pdf in order to print a specific pdf file, and save it (using the microsoft print to pdf) as another pdf file.
I searched and found this issue:
How to programmatically print to PDF file without prompting for filename in C# using the Microsoft Print To PDF printer that comes with Windows 10
however, i do not understand where is the input pdf (i.e - the file to be printed).
I guess that's something very basic that I am searching... help will be much appreciated!
Windows 10 includes native support for creating PDF files using Microsoft Print to PDF, a virtual printer.
ie; We can print to PDF or Save as PDF file in Windows 10 without installing any third party software.
Find below the step-by-step process to print to PDF.
Open the file you want to print to PDF and right click on it or open the Print menu (Ctrl +P) and select the ‘Print’ option.
Now you will get an option to select the Printer from a list of installed printers. Find and select ‘Microsoft Print to PDF‘ and click on ‘Print‘ button.
You will get an option to choose the location and click ‘OK’ to save the file. The file is saved as a brand new PDF document.
How to Enable and Activate the Print to PDF Feature on Windows 10
If Microsoft Print to PDF option is missing from the list of printers (Select Printer Option), you can Enable Microsoft Print to PDF Printer easily using any of the following methods.
Enable Microsoft Print to PDF on Windows Settings Page
Add a Printer through Devices and Printers in Control Panel
Enable Print to PDF from Windows Features
Check this Post: https://admeonline.com/how-to-print-to-pdf-in-windows-10-save-as-pdf-printer/

Embedded PDF prints off-center

<embed width="100%" height="100%" src="filename.pdf" type="application/pdf">
I can embed a PDF file into a web page using the simple code above. But when I go to print the web page (using CTRL+P), only half the PDF appears on the print preview as it has been off-centred. The same happens on this web page: http://pdfobject.com/examples/simplest-full-window.html.
Here is an example of a 'Print Version' web page where the embedded PDF centres when it is printed (CTRL+P): http://www.bbc.co.uk/food/recipes/our_paella_92328.pdf. This example is also responsive, which is useful as the print appearance remains consistent no matter the size of the browser window.
Firstly how do I centre the embedded PDF upon printing? Secondly, how do I make the embedded PDF responsive?
When you want to print an embedded PDF, you must use the print command from the PDF plugin, not the print command from the web browser.
In the first example the Javascript code loads the PDF plugin and replaces the HTML document with the PDF document. If you hit CTRL+P then the print dialog from Internet Explorer is shown. If you click into the PDF plugin then press CTRL+P, then the print dialog from Adobe PDF plugin is shown.
In second example you open directly the PDF file. In this case the PDF plugin is loaded and activated automatically. No need to click in it. Pressing CTRL+P brings its own print dialog.

Issues printing embedded PDF

I have embedded a pdf object in a webpage. When I print this page, the embedded object does not show in the printout. The only way to print the pdf is to use the print function of the plugin, however I need to add some headers to the pdf document that is on the top of the web page. Is there a way to achieve this?

Non printable PDF

I've generated a PDF using Itext which I can open but when I try to print I get an error saying than the document is not printable. The document is generated without any non-printable flag.
Any hint?
Thanks
If the print option in Adobe Reader is not disabled then the document has no print restrictions. If the error appears when you try to print the document, it is possible that the page content is damaged. I've seen PDF files that Adobe Reader could display but it showed an error when trying to print or save them.
this can only happen if you change the permission of
the file.
Did you perhaps copy a PdfStamper sample that has a line disabling the
print
unless
There are 10 entries under Document Restrictions Summary in the security tab.
in PdfWriter,
set
ALLOW_PRINTING = 2052