/// <summary> /// Aggiunge un immagine come pagina al documento /// </summary> /// <param name="buffer"></param> public void AddPdfFromImageBuffer(byte[] buffer, params int[] pages) { var conv = new PdfConvert(); using (var ms = new MemoryStream()) { conv.ImageBufferToPdfStream(buffer, ms); ms.Position = 0; this.AddPdfFromStream(ms); } }
public void TestTiffMP() { var pc = new App.PdfUtils.PdfConvert(); pc.Author = @"Simone Pelaia"; pc.Title = "Prova Tiff multipagina"; pc.Subject = @"Tiff MP"; using (var ms = new MemoryStream()) { pc.ImageBufferToPdfStream(TestResources.Multi_page24bpp, ms); Assert.IsFalse(ms.Length == 0); File.WriteAllBytes(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "TestTiff.pdf"), ms.ToArray()); } }