Print settings in post script (.ps) file

I am using Aspose Word to convert a docx file to ps file. How do we add the print settings (Simplex/Duplex, B&W/Color, Portrait/Landscape) to the ps file while converting docx to ps?

@anjanbabuv,

Thanks for your inquiry. Unfortunately, Aspose.Words does not provide API to add printer settings to PS. However, we have logged this feature request as WORDSNET-16469 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

@anjanbabuv

Please note that Aspose.PDF API supports specifying your required settings, while PDF to PS conversion. You may please convert your Word Document to PDF using Aspose.Words and generate .ps file from obtained PDF document while using Aspose.PDF. Please check following code snippet, in order to achieve your requirement:

Aspose.Words.Document doc = new Words.Document(dataDir + "Test-Word1.docx");
doc.Save(dataDir + "Test-Word1.pdf", Words.SaveFormat.Pdf);
Aspose.Pdf.Facades.PdfViewer viewer = new Aspose.Pdf.Facades.PdfViewer();
viewer.BindPdf(dataDir + "Test-Word1.pdf");
// set PrinterSettings and PageSettings
System.Drawing.Printing.PrinterSettings printerSetttings = new System.Drawing.Printing.PrinterSettings();
printerSetttings.Copies = 1;
printerSetttings.Duplex = System.Drawing.Printing.Duplex.Default;
printerSetttings.DefaultPageSettings.Landscape = true;
printerSetttings.DefaultPageSettings.Color = true;
// set PS printer, one can find this driver in the list of preinstalled printer drivers in Windows
printerSetttings.PrinterName = "HP LaserJet 2300 Series PS";
// set output file name and PrintToFile attribute
printerSetttings.PrintFileName = "d:/Test-Word1.ps";
printerSetttings.PrintToFile = true;
// disable print page dialog
viewer.PrintPageDialog = false;
// pass printer settings object to the method
viewer.PrintDocumentWithSettings(printerSetttings);
viewer.Close();

In case you face any issue, while using above code snippet - please share your input document with us. We will test the scenario in our environment and address it accordingly.

Hi Asad,

Thanks for the response.

The solution you suggested above is used to print the document using the printer settings.

What I want is to create a ps file from a docx file and save the printer settings into the ps file itself and place it a shared network place, from this place other team will pick the file and print it as per the settings.

Please see if my question is clear to you or else I will explain it with more details.

@anjanbabuv,

Thanks for sharing the detail. We logged this feature in our issue tracking system. We will inform you once this feature is available. Please let us know if you have any more queries.

Hello Tahir,

I want to know that what all does Aspose Words do now related to post script?

It only just converts .docx file to .ps file? I can not make any changes to it to add the printer settings?

I see psSaveOptions where I can set some attributes, What is the use of those settings?.

Do you have any contact number… I want to discuss this scenario in detail.

Thanks,
Anjan

also, can you elaborate the usecase of word to PS conversion options available in aspose words for .net product. how the user is supposed to print the PS file once created in aspose words for .NET.

Any help is appreciated.

Thanks,
Mahesh

@anjanbabuv,

Thanks for your inquiry.

Please check the members of PsSaveOptions class. Aspose.Words saves the DOCX to PS with PsSaveOptions. However, it does export the PS file with printer settings.

We only provide support via forum. Please share the complete detail of your use case and requirement. We will then update the feature (WORDSNET-16469) in our issue tracking system accordingly.

@maheshkumar_devata_ky_gov,

Thanks for your inquiry.

Aspose.Words does not provide API to print the PS file. You can save the Word document to PS with PsSaveOptions that are not related to printer setting. However, you can directly print the Document with printer setting using Document.Print (PrinterSettings) method. This method prints the document according to the specified printer settings, using the standard (no User Interface) print controller.

Thanks for the response.

Our requirement is to store the printer settings into the ps file i.e., at the time of conversion of docx to ps, we need the ability to have the printer settings added into the ps file. So that we can place the final file at a shared location, from where the other team will pick the file and print as per the settings that we have added in the file.

Can you please tell me like what is the timeframe to have this feature in Aspose Words .Net.

Thanks,
Anjan

@anjanbabuv,

Thanks for your inquiry. We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. Our developers work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.

Currently, this feature is pending for analysis and is in the queue. Once our product team completes the analysis, we will then be able to provide you an estimate.

You reported this issue in free support forum and it will be treated with normal priority. To speed up the progress of issue’s resolution, we suggest you please check our paid support policies from following link.
Paid Support Policies

@anjanbabuv,

As per our understanding, you want to create PS file that would contain printer settings only with no data. Please note that this is not what Aspose.Words is meant to be used.

If you have such file, how you would use it? If you understand PostScript format, please share how you will use “printer settings file”. PostScript specification does not have any information about special “print settings files”.

It would be great if you please ZIP and attach your input Word document and expected output PS file here for our reference. Thanks for your cooperation.

A post was split to a new topic: Print Setting of PS file