SDK renders PDF page (draw text, images and graphics on PDF page) when converting PDF document to a TIFF file.
By default SDK:
' The project, which uses this code, must have references to the following assemblies: ' - Vintasoft.Imaging ''' <summary> ''' Class shows how to convert PDF document to TIFF file using ImageCollection and TiffEncoder classes. ''' </summary> Public Class ConvertPdfToTiffUsingEncoder ''' <summary> ''' Converts PDF document to TIFF file using ImageCollection and TiffEncoder classes. ''' </summary> Public Shared Sub Convert(pdfFileName As String, tiffFileName As String) ' create image collection Using imageCollection As New Vintasoft.Imaging.ImageCollection() ' add PDF document to collection imageCollection.Add(pdfFileName) ' create TiffEncoder Using tiffEncoder As New Vintasoft.Imaging.Codecs.Encoders.TiffEncoder(True) ' set TIFF compression to Zip tiffEncoder.Settings.Compression = Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip ' save images of image collection to TIFF file using TiffEncoder imageCollection.SaveSync(tiffFileName, tiffEncoder) End Using ' dispose images imageCollection.ClearAndDisposeItems() End Using End Sub End Class
// The project, which uses this code, must have references to the following assemblies: // - Vintasoft.Imaging /// <summary> /// Class shows how to convert PDF document to TIFF file using ImageCollection and TiffEncoder classes. /// </summary> public class ConvertPdfToTiffUsingEncoder { /// <summary> /// Converts PDF document to TIFF file using ImageCollection and TiffEncoder classes. /// </summary> public static void Convert(string pdfFileName, string tiffFileName) { // create image collection using (Vintasoft.Imaging.ImageCollection imageCollection = new Vintasoft.Imaging.ImageCollection()) { // add PDF document to collection imageCollection.Add(pdfFileName); // create TiffEncoder using (Vintasoft.Imaging.Codecs.Encoders.TiffEncoder tiffEncoder = new Vintasoft.Imaging.Codecs.Encoders.TiffEncoder(true)) { // set TIFF compression to Zip tiffEncoder.Settings.Compression = Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip; // save images of image collection to TIFF file using TiffEncoder imageCollection.SaveSync(tiffFileName, tiffEncoder); } // dispose images imageCollection.ClearAndDisposeItems(); } } }
' The project, which uses this code, must have references to the following assemblies: ' - Vintasoft.Imaging ''' <summary> ''' Class shows how to convert PDF document to TIFF file using ImageCollection and TiffEncoder classes. ''' PDF document is rendered with specified resolution. ''' </summary> Public Class ConvertPdfToTiffUsingEncoderWithSpecifiedResolution ''' <summary> ''' Converts PDF document to TIFF file using ImageCollection and TiffEncoder classes. ''' PDF document is rendered with specified resolution. ''' </summary> Public Shared Sub Convert(pdfFileName As String, tiffFileName As String, dpi As Single) ' create image collection Using imageCollection As New Vintasoft.Imaging.ImageCollection() ' add PDF document to collection imageCollection.Add(pdfFileName) ' set rendering settings imageCollection.SetRenderingSettings(New Vintasoft.Imaging.Codecs.Decoders.RenderingSettings(dpi, dpi, System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear, System.Drawing.Drawing2D.SmoothingMode.AntiAlias)) ' create TiffEncoder Using tiffEncoder As New Vintasoft.Imaging.Codecs.Encoders.TiffEncoder(True) ' set TIFF compression to Zip tiffEncoder.Settings.Compression = Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip ' save images of image collection to TIFF file using TiffEncoder imageCollection.SaveSync(tiffFileName, tiffEncoder) End Using ' dispose images imageCollection.ClearAndDisposeItems() End Using End Sub End Class
// The project, which uses this code, must have references to the following assemblies: // - Vintasoft.Imaging /// <summary> /// Class shows how to convert PDF document to TIFF file using ImageCollection and TiffEncoder classes. /// PDF document is rendered with specified resolution. /// </summary> public class ConvertPdfToTiffUsingEncoderWithSpecifiedResolution { /// <summary> /// Converts PDF document to TIFF file using ImageCollection and TiffEncoder classes. /// PDF document is rendered with specified resolution. /// </summary> public static void Convert(string pdfFileName, string tiffFileName, float dpi) { // create image collection using (Vintasoft.Imaging.ImageCollection imageCollection = new Vintasoft.Imaging.ImageCollection()) { // add PDF document to collection imageCollection.Add(pdfFileName); // set rendering settings imageCollection.SetRenderingSettings(new Vintasoft.Imaging.Codecs.Decoders.RenderingSettings( dpi, dpi, System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear, System.Drawing.Drawing2D.SmoothingMode.AntiAlias)); // create TiffEncoder using (Vintasoft.Imaging.Codecs.Encoders.TiffEncoder tiffEncoder = new Vintasoft.Imaging.Codecs.Encoders.TiffEncoder(true)) { // set TIFF compression to Zip tiffEncoder.Settings.Compression = Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip; // save images of image collection to TIFF file using TiffEncoder imageCollection.SaveSync(tiffFileName, tiffEncoder); } // dispose images imageCollection.ClearAndDisposeItems(); } } }
' The project, which uses this code, must have references to the following assemblies: ' - Vintasoft.Imaging ' - Vintasoft.Imaging.Pdf ''' <summary> ''' Class shows how to convert PDF document to TIFF file using PdfDocument and TiffFile classes. ''' </summary> Public Class ConvertPdfToTiffUseImageFile ''' <summary> ''' Converts PDF document to TIFF file using PdfDocument and TiffFile classes. ''' </summary> Public Shared Sub Convert(pdfFileName As String, tiffFileName As String) ' open existing PDF document Using pdfDocument As New Vintasoft.Imaging.Pdf.PdfDocument(pdfFileName) ' create new TIFF file Using tiffFile As New Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile(tiffFileName, Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFileFormat.LittleEndian) ' set TIFF compression to Zip tiffFile.Pages.EncoderSettings.Compression = Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip ' for each PDF page For i As Integer = 0 To pdfDocument.Pages.Count - 1 ' render PDF page and add as image to Tiff file tiffFile.Pages.Add(pdfDocument.Pages(i).Render()) ' save changes to TIFF file tiffFile.SaveChanges() Next End Using End Using End Sub End Class
// The project, which uses this code, must have references to the following assemblies: // - Vintasoft.Imaging // - Vintasoft.Imaging.Pdf /// <summary> /// Class shows how to convert PDF document to TIFF file using PdfDocument and TiffFile classes. /// </summary> public class ConvertPdfToTiffUseImageFile { /// <summary> /// Converts PDF document to TIFF file using PdfDocument and TiffFile classes. /// </summary> public static void Convert(string pdfFileName, string tiffFileName) { // open existing PDF document using (Vintasoft.Imaging.Pdf.PdfDocument pdfDocument = new Vintasoft.Imaging.Pdf.PdfDocument(pdfFileName)) { // create new TIFF file using (Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile tiffFile = new Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile(tiffFileName, Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFileFormat.LittleEndian)) { // set TIFF compression to Zip tiffFile.Pages.EncoderSettings.Compression = Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip; // for each PDF page for (int i = 0; i < pdfDocument.Pages.Count; i++) { // render PDF page and add as image to Tiff file tiffFile.Pages.Add(pdfDocument.Pages[i].Render()); // save changes to TIFF file tiffFile.SaveChanges(); } } } } }
' The project, which uses this code, must have references to the following assemblies: ' - Vintasoft.Imaging ' - Vintasoft.Imaging.Pdf ''' <summary> ''' Class shows how to convert PDF document to TIFF file using PdfDocument and TiffFile classes. ''' PDF document is rendered with specified resolution. ''' </summary> Public Class ConvertPdfToTiffUseImageFileWithSpecifiedResolution ''' <summary> ''' Converts PDF document to TIFF file using PdfDocument and TiffFile classes. ''' PDF document is rendered with specified resolution. ''' </summary> Public Shared Sub Convert(pdfFileName As String, tiffFileName As String, dpi As Single) ' open existing PDF document Using pdfDocument As New Vintasoft.Imaging.Pdf.PdfDocument(pdfFileName) ' set resolution pdfDocument.RenderingSettings.Resolution = New Vintasoft.Imaging.Resolution(dpi, dpi) ' set rendering mode - optimal balance between rendering speed and quality pdfDocument.RenderingSettings.RenderingMode = Vintasoft.Imaging.Pdf.PdfRenderingMode.Normal ' create new TIFF file Using tiffFile As New Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile(tiffFileName, Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFileFormat.LittleEndian) ' set TIFF compression to Zip tiffFile.Pages.EncoderSettings.Compression = Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip ' for each PDF page For i As Integer = 0 To pdfDocument.Pages.Count - 1 ' render PDF page and add as image to Tiff file tiffFile.Pages.Add(pdfDocument.Pages(i).Render()) ' save changes to TIFF file tiffFile.SaveChanges() Next End Using End Using End Sub End Class
// The project, which uses this code, must have references to the following assemblies: // - Vintasoft.Imaging // - Vintasoft.Imaging.Pdf /// <summary> /// Class shows how to convert PDF document to TIFF file using PdfDocument and TiffFile classes. /// PDF document is rendered with specified resolution. /// </summary> public class ConvertPdfToTiffUseImageFileWithSpecifiedResolution { /// <summary> /// Converts PDF document to TIFF file using PdfDocument and TiffFile classes. /// PDF document is rendered with specified resolution. /// </summary> public static void Convert(string pdfFileName, string tiffFileName, float dpi) { // open existing PDF document using (Vintasoft.Imaging.Pdf.PdfDocument pdfDocument = new Vintasoft.Imaging.Pdf.PdfDocument(pdfFileName)) { // set resolution pdfDocument.RenderingSettings.Resolution = new Vintasoft.Imaging.Resolution(dpi, dpi); // set rendering mode - optimal balance between rendering speed and quality pdfDocument.RenderingSettings.RenderingMode = Vintasoft.Imaging.Pdf.PdfRenderingMode.Normal; // create new TIFF file using (Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile tiffFile = new Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFile(tiffFileName, Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffFileFormat.LittleEndian)) { // set TIFF compression to Zip tiffFile.Pages.EncoderSettings.Compression = Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip; // for each PDF page for (int i = 0; i < pdfDocument.Pages.Count; i++) { // render PDF page and add as image to Tiff file tiffFile.Pages.Add(pdfDocument.Pages[i].Render()); // save changes to TIFF file tiffFile.SaveChanges(); } } } } }