Create a PDF from a TIFF file

The code below shows you how to use the ImagePrintProvider class to convert a TIFF file to a PDF.

This sample requires a Tools license.

using System;
using System.IO;
using SolidFramework.Plumbing;
using SolidFramework.Pdf.Creators;
using SolidFramework.Pdf;
using SolidFramework.Pdf.Creators.Plumbing;

namespace TIFFtoPDF
    class Program
        static void Main(string[] args)
            // Call your Solid Documents License

            // Set the location of your the file you want to convert
            String pdfPath = @"C:\YourFolder\yourpdf.tif";

            //*TIFF to PDF*//
            using (ImagePrintProvider imagePrintProvider = new ImagePrintProvider())
                // Set the type of Image Optimization
                imagePrintProvider.Optimize = Optimize.Professional;

                // Add the source file

                // Create a PDF document object
                PdfDocument document = imagePrintProvider.PdfCreator.PdfDocument;

                // Set the output path and the file type
                document.Path = Path.ChangeExtension(pdfPath, ".pdf");

                // Convert and Save the file


Imports System.IO
Imports SolidFramework.Plumbing
Imports SolidFramework.Pdf

Module TIFFtoPDF

    Sub Main()

        ' Call your Solid Documents License

        'Define a variable for your source file
        Dim sPdfPath As String

        ' Define a PDF Document 
        Dim myDocument As SolidFramework.Pdf.PdfDocument

        ' Define your Solid Framework Converter
        Dim myConverter As SolidFramework.Pdf.Creators.ImagePrintProvider

        ' Set your file path 
        sPdfPath = "C:\YourFolder\filepdf.pdf"

        ' Set the converter
        myConverter = New SolidFramework.Pdf.Creators.ImagePrintProvider

        ' Set the PDF Document
        myDocument = New PdfDocument

        'Set the preferred conversion properties 

        ' Set the type of Image Optimization
        myConverter.Optimize = Creators.Plumbing.Optimize.Professional

        'Add the source file

        ' Create a PDF document object
        myDocument = myConverter.PdfCreator.PdfDocument

        ' Set the output path and the file type
        myDocument.Path = Path.ChangeExtension(sPdfPath, ".pdf")

        'Convert and Save the file

        ' Clean up

    End Sub

End Module