Jude
Jude

Reputation: 2433

ItextSharp, Save Pdf Without Displaying Open / Save Dialog Box

Is it possible not to show Open/Save dialog? I would like to save the pdf file straight to specific disk location on client PC.

Upvotes: 0

Views: 853

Answers (1)

ovaltein
ovaltein

Reputation: 1215

Yes, you can write the file directly to disk without the use of a save dialog. All you need is a directory path to write too.

string path = "C:\YourDirectoryPathHere";

System.IO.File.WriteAllBytes(Path.Combine(path, "NameYourFile.pdf"), myPDF);

This assumes myPDF is a byte[].

Upvotes: 1

Related Questions