We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Restricted printing using aspose.pdf

I have a requirement in asp.net web application to use aspose pdf viewer control for viewing the pdf file. It should allow printing without showing the print dialog box for selecting the printers. It should be able to fetch the available printers at client side and document should be printed to a valid printer and not on any file printer like print to pdf or xps. Please suggest , is it possible using aspose.pdf ?

It is very urgent.

Thank You.


Hi Surya,<o:p></o:p>

Thank you for considering Aspose.Pdf.<o:p></o:p>

Aspose.Pdf is not a visual tool / control to view PDF
files in Web page as a control. It is a component to generate new Pdf files and
manipulate the existing files programmatically. PdfViewer class in
Aspose.Pdf.Facades namespace can be used for printing the PDF document
programmatically. So, if you want to print a certain PDF file programmatically,
you can use PdfViewer. Please see the following sample code regarding Printing
of PDF file using the Default Printer. Also, you can use
PdfViewer.PrintPageDialog property to allow or restrict the print dialog.<o:p></o:p>

PDF File to Default Printer using Printer and Page Settings

Please feel free to contact support in case you have any
further queries.<o:p></o:p>

Thank You & Best Regards,

Thanks a lot Nausharwan for replying,

I would require some more detail, as you said aspose is not a visual tool or control for displaying the pdf in a web page so does it has capability to restrict users from saving the file in any way?

As per my current requirement, we are using asp.net web application and one pdf document will be updated using aspose for personalised watermarking and this file should not be downloaded or saved on client machine at any cost. So my question is if we can use aspose pdfviewer class to restrict saving at client machine in case it is a browser viewing of pdf file. And does restricting print to a valid physical printer( and not to any file printer like xps or print to pdf) work in a web environment where code executes at server side and not at client machine.

Please suggest on this. Appreciate your help.

Thank You.


Hi Surya,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Well, you can use the security options to apply different security settings (like restricting printing) to your PDF file programmatically and then you can send the file to the user’s browser for viewing (to be viewed in Adobe Acrobat or some other tool as Aspose.Pdf does not provide a visual tool). You may check the following documentation link for sample code and details in this regard:

Set Privileges on an Existing PDF File (Facades)

Now, the issue / problem is that “Save As” option (in Adobe Acrobat) is not a PDF document property and we cannot restrict this option using Aspose.Pdf for .NET. So, it may not be possible to restrict the user to save a copy of the PDF file on his machine.

Please feel free to contact support in case you have any further queries.

Thank You & Best Regards,