5
I wonder if there’s a way to turn multiple images into a single PDF file. On my app I’m already pulling their address.
5
I wonder if there’s a way to turn multiple images into a single PDF file. On my app I’m already pulling their address.
2
Using the iTextSharp 4, can be done as follows:
iTextSharp.text.Document Doc = new iTextSharp.text.Document(PageSize.LETTER, 20, 20, 20, 20);
string PDFOutput = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Output.pdf");
PdfWriter writer = PdfWriter.GetInstance(Doc, new FileStream(PDFOutput, FileMode.Create, FileAccess.Write, FileShare.Read));
Doc.Open();
string Folder = "C:\\Diretorio\\das\\Imagens";
foreach (string F in System.IO.Directory.GetFiles(Folder, "*.jpg"))
{
Doc.NewPage();
Doc.Add(new iTextSharp.text.Jpeg(new Uri(new FileInfo(F).FullName)));
}
Doc.Close();
Browser other questions tagged c# pdf
You are not signed in. Login or sign up in order to post.
Da uma olhda neste link --> http://www.pdfsharp.net/wiki/ExportImages-sample.ashx?AspxAutoDetectCookieSupport=1 e neste outro --> http://weblogs.asp.net/andrenobre/gerando-arquivos-pdf-net-e-e-xtitesharp
– MeuChapeu
If you choose to call an external application, see about
ImageMagick
andPDFTK
. They are very easy to use, do very well the service, and running external applications in C# is very simple. Of course it is not always ;D option– Vinícius Gobbo A. de Oliveira