Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Aug 18, 2023 8:34 pm

I am using below code to convert a pdf file to postscript file -

PdfDocument document = new PdfDocument();
document.LoadFromFile("test.pdf");
document.PrintSettings.PrinterName = "DuplexPrinter";
document.SaveToFile("test.ps", FileFormat.POSTSCRIPT);

Question 1 - Will above commands help me to create a postscript file according to the printer settings that i have made for the "DuplexPrinter"?
'DuplexPrinter' was created using Add Printer and i am using the printer preferences to set the printer style, color, landscape, Three punch settings etc..

Question 2 - After the postscript is created, i want to search the postscript file for Duplex ON/OFF. How can i do that?

NOC
 
Posts: 9
Joined: Thu Aug 03, 2017 9:04 pm

Mon Aug 21, 2023 5:37 am

Hi

Thanks for your inquiry.
Firstly, I tested the code you provided. Your code can help you create a postscript file.
The code:
Code: Select all
document.PrintSettings.PrinterName = "DuplexPrinter"

The above code can only specifies the printer when printing pdf file, but it doesn’t support add your printer settings to the result postscript file,Then,sorry, Spire.PDF currently doesn't support parsing postscript files to get the printing setting of Duplex ON/OFF.

Sincerely,
Ula
E-iceblue support team
Last edited by Ula.wang on Wed Oct 11, 2023 8:56 am, edited 1 time in total.
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Tue Sep 05, 2023 8:19 am

Hi

I would like to know if the solution we have provided has helped you solved the problem you have encountered, and our team expected to have more communication with you.
If my solution doesn’t help you, please offer the following information to help us do further investigation. Thank you in advance.
1)Your input test file, you can attach here or send it to us via email (support@e-iceblue.com).
2) Your full test code that can reproduce your issue.
3) Application type, such as Console App, .NET Framework 4.8.
4) Your test environment, such as OS info (E.g. Windows 7, 64-bit).

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Return to Spire.PDF