1
private void GerarPDF(string pCaminhoArquivoPDF)
{
Document doc = new Document();
// Aqui acontece o erro
PdfWriter.GetInstance(doc, new FileStream(pCaminhoArquivoPDF,FileMode.Create));
try
{
Paragraph p = new Paragraph(textBox1.Text);
doc.Open();
doc.Add(p);
doc.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace);
//throw;
}
}
private void OndeGerar(Object o,EventArgs e)
{
GerarPDF( @"C:\Users\CAIO\Desktop\PDF's");
}
Try running Visual Studio in administrator mode.
– Pedro Paulo
Normally denied access error may be that the path you are trying to access doesn’t even exist. This has happened to me before and I kept thinking that it could be something of access, but in the end, it was I who was passing the wrong way!
– perozzo
Can that quote there, from
PDF's
?– Marcelo Shiniti Uchimura
@Marcelouchimura Yes, "Arnaldo" :)
– Leandro Angelo