Hi Jane,
Thank you for your interest in Essential PDF.
Issue 1: (provide dialog for user to choose the path)
--------
You can use SaveFileDialog class to provide dialog for user to choose the path and name.
[C#]
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "Files(*.pdf)|*.pdf";
saveFileDialog.AddExtension = true;
saveFileDialog.DefaultExt = ".pdf";
if (saveFileDialog.ShowDialog() == DialogResult.OK && saveFileDialog.CheckPathExists)
{
//Save the PDF Document to disk.
pdfDoc.Save(saveFileDialog.FileName);
pdfDoc.Close();
//Message box confirmation to view the created PDF document.
if (MessageBox.Show("Do you want to view the PDF file?", "PDF File Created",
MessageBoxButtons.YesNo, MessageBoxIcon.Information)
== DialogResult.Yes)
{
Process proc = new Process();
proc.StartInfo.FileName = saveFileDialog.FileName;
proc.Start();
}
}
Please refer the (modified - if one is provided earlier) sample in the below link which illustrates the above.
http://websamples.syncfusion.com/samples/XlsIO.Windows/67104/main.htmPlease try running the above sample and let me know if this helps.
Issue 2: (the file has to be closed)
--------
You can close the document by using close method of PDFDocument.
[C#]
//Save
pdfDocument.Save("report.pdf");
//Close the document
pdfDoc.Close();
//Open
System.Diagnostics.Process.Start("report.pdf");
Please let me know if you have any other questions.
Thanks,
Melba