I am having issues getting my text to appear on a print preview document. I have not tried printing yet, since I cannot get the print preview to work correctly. I have looked through the MSDN references and found nothing related to setting the text, only setting the document. The document does exist and I have checked that multiple times. I think this is simply coming down to a very stupid error on my part and I cannot find out what it is.
Code:
private void printPreviewToolStripButton_Click(object sender, EventArgs e)
{
if (open)
{
PrintDocument pd = new PrintDocument();
PrintPreviewDialog ppd = new PrintPreviewDialog();
string docName = "";
string docPath = "";
/* do other stuff not related to printing */
docName = "pressureconversion.txt"; // the test file with valid text
docPath = "./";
pd.DocumentName = docPath + docName;
//MessageBox.Show(docName); // test to see correct name
//MessageBox.Show(docPath); // test to see correct path
ppd.Document = pd;
ppd.ShowDialog();
}
else
{
MessageBox.Show("There is nothing currently open!");
}
}