Want to print a Text File


#1

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…


#2

Hai @Rajtk7,

You need to convert text file into pdf file Right?

Regards,
D.Aravind


#3

Yes Aravind


#4

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


#5

Could you share your workflow file.,

Regards,
D.Aravind


#6

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.


#7

@Rajtk7 its working properly only what the need in that


#8

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


#9

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