将 PDF 文件保存到桌面 [VB .NET]

问题描述:

我想将 PDF 文件保存到我的桌面.这段代码我把它们保存在 bin 文件夹中

I want to save PDF files to my desktop. This code I have saves them in the bin folder

Dim pdf = gvwProyectos.SelectedRows.Count > 0
        Dim pdfDoc As New Document(iTextSharp.text.PageSize.A4)
        Dim pdfWrite As PdfWriter = PdfWriter.GetInstance(pdfDoc, New FileStream("Reporte.pdf", FileMode.Create))

顺便说一句,我正在使用 iTextSharp.

I'm using iTextSharp btw.

好的,我已经知道怎么做了,但我会把对我有用的东西留在这儿.

Ok, I already find out how to do it but I'll leave what worked for me in here.

        Dim pdfDoc As New Document(iTextSharp.text.PageSize.A4)
        Dim pdfWrite As PdfWriter = PdfWriter.GetInstance(pdfDoc, New FileStream(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + "yourPDFdesiredName.pdf", FileMode.Create))