Want to print a Text File

I want to print a Text file but it is printing an empty document, there is no contents inside the generated PDF Printed file.

var pd = new PrintDocument
{
DocumentName = fileName,
DefaultPageSettings =
{
Landscape = this.Landscape
}
};
pd.Print();

Can someone please help…

Hai @Rajtk7,

You need to convert text file into pdf file Right?

Regards,
D.Aravind

Yes Aravind

But when i am using process.start. Print concept it’s printing in Portrait Mode. But i want in Landscape.

Could you share your workflow file.,

Regards,
D.Aravind

Main (1).xaml (7.4 KB)
1.xls (1021 Bytes)

Change the .xls file extension to .txt.

i am trying to print it in same format/ look. If we print in Landscape then its comes in proper way.

@Rajtk7 its working properly only what the need in that

ok. is there any option to change the printer settings to landscape mode. Any xaml file . invoke code pls

Hi @Rajtk7

Check out this post. From reading your xaml, you’re setting the DefaultPage setting for the printer. Try to set it for the document itself.

HTH
Troy

I also encountered a similar problem with my Hp Designjet T795. While I tried to print any papers it’s showing an unknown error for that I was unable to complete the printing. I could not understand what to do in this situation. Please help.