Product Info


Overview

Licensing

FAQ

Forums

Examples

History


Downloads

Evaluation version

On-line manual

Purchase

Buy now

Contact us

Testimonials


Been a self employed software engineer myself, i cannot tell you enough how i appreciate your professionalism and your work.

Keep up this more than excellent work, i hope every potential customer really gives you the credits you deserve and quickly becomes a new, very satified customer. It is the best investment for their money they can make and never ever regret it.

Yannis Sferopoulos
Opendata Ltd





VintaSoftPDF.NET Plug-in - FAQ

General questions:

 

Redistribution:

 

PDF:

 

Programming:

 

 

For which purposes can I use the VintaSoftPDF.NET Plug-in?

You can use it as plug-in for VintaSoftImaging.NET SDK and it will allow you display, render, create, convert, annotate, print, save, manipulate and edit pages of PDF files.

 

 

From which parts does the plug-in consist?

The library contains:

  • Vintasoft.PDF.dll assembly - a 100% .NET assembly
  • Documentation in CHM format (VintaSoft.Imaging.chm file)
  • Examples for MS Visual Basic.NET, MS Visual C#, ASP.NET (files in the Examples directory)
  • Demo applications (files in Bin\v2.0 directory)

 

 

In which programming languages can I use the plug-in?

With Single Developer license or Site license you can use component in:

  • Microsoft Visual Studio .NET : Visual Basic, Visual C#, Visual C++, Visual J#
  • Borland Delphi 8.0, Borland C# Builder, Borland C++ BuilderX
  • any other languages which are compatible with .NET Framework.

With Server license you can use component in:

  • Intranet / internet applications on a server-side (ASP.NET or PHP)

 

 

What restrictions does the unregistered version have?

Unregistered version has the following restrictions:

  • nag screen
  • watermark
  • change of some PDF file tags disabled

All these restrictions are removed in registered version.

 

 

I have problems. What should I do?

Answers to most of questions can be found in the documentation or in this FAQ. Please write to our support team to get more help.

 

 

What files do I need to include in the setup package of my program?

You need include two files: VintaSoft.Imaging.dll and Vintasoft.PDF.dll. These files must be placed in the same folder as the assembly that references them. Make sure that the version you distribute is the version your assembly was compiled with.

 

 

Can I re-distribute Vintasoft.PDF.dll with my application without royalties?

Yes, this component is royalty free. You pay only for registration one time.

Only Vintasoft.PDF.dll can be re-distributed with your application. Site license has no limitations in re-distribution. Single Developer license has limitation in re-distribution. Server license is not royalty free. Please read the license agreement for more information.

 

 

I cannot open PDF file using your library. What should I do?

Please send us your "bad" file. We will analyze it and update our reading algorithm if image is correct.

 

 

PDF document is displayed incorrectly. What should I do?

It's possible that while a page was generated:

  • error occur
  • warning appear
  • page contain unsupported elements

Error (PDFRuntimeError): appear when there was an attempt to draw unsupported element (e.g. JPEG2000 image), or an internal error occur in the library. Errors at page elements drawing indicate that the page was drawn incorrectly.

Warning (PDFRuntimeWarning): appear when there were used unsupported color correction functions (e.g. ICCProfile). The warning means that the element has been completely drawn, but this color correction function did not apply.

In the current version of library are unsupported:

  • Fonts: MMType1; OpenType
  • ColorSpaces: CALGray; CALRGB; DeviceN, Lab;
  • Images: JPEG2000 images; non-idexed JPEG images based on CMYK color space; images based on CALGray, CALRGB, DeviceN, Lab color spaces
  • ShadingPatterns: TensorProductPatchMesh; CoonsPatchMesh
  • Functions: PostScriptCalculator
  • ColorCorrection: ICCProfile; Rendering Intents

Errors and warnings may also occur during saving a file to PDF/A.

To find out whether the document was drawn correctly (are there any unsupported elements or occur errors), it is necessary to use property PDFDocument.RuntimeMessages. Here is an example of code to calculate the errors / warnings in the document:

[VB.NET]
Public Shared Sub TestDocument(ByVal fileName As String, ByRef errors As Integer, ByRef warnings As Integer)
    ' open document
    Dim document As New PdfDocument(fileName)
    errors = 0
    warnings = 0
    For i As Integer = 0 To document.Pages.Count - 1
        ' clear messages
        document.RuntimeMessages.Clear()
        ' renderer page
        Dim pageImage As VintasoftImage = document.Pages(i).Render()
        pageImage.Dispose()
        ' check messages
        For Each message As PdfRuntimeMessage In document.RuntimeMessages
            If TypeOf message Is PdfRuntimeWarning Then
                warnings += 1
            ElseIf TypeOf message Is PdfRuntimeError Then
                errors += 1
            End If
        Next
    Next
End Sub

[C#]
public static void TestDocument(string fileName, out int errors, out int warnings)
{
    // open document
    PdfDocument document = new PdfDocument(fileName);
    errors = 0;
    warnings = 0;
    for (int i = 0; i < document.Pages.Count; i++)
    {
        // clear messages
        document.RuntimeMessages.Clear();
        // render the page
        VintasoftImage pageImage = document.Pages[i].Render();
        pageImage.Dispose();
        // check messages
        foreach (PdfRuntimeMessage message in document.RuntimeMessages)
        {
            if (message is PdfRuntimeWarning)
                warnings++;
            else if (message is PdfRuntimeError)
                errors++;
        }
    }
}

If the document was drawn with error, but the library has not reported about this error, or if an error occur and it is not related with unsupported elements — send your PDF document to VintaSoft support team for further review and debugging.

 

 

How do I pack PDF document?

Packing (PDFDocument.Pack) allows:

  • remove unusable objects from document
  • change version of PDF file (e.g. convert to PDF/A)
  • specify usage of Cross-Reference tables compression (from version 1.5 of PDF specification)
  • specify usage of text filters for binary data

Usage of PDFDocument.Optimize functions allows to set a way of compression for different objects: color images, black-and-white images, data. Before the end of work the Optimize function will call the pack function.

Here is an example that shows how to pack PDF file (optimize=false) or how to pack PDF file and convert all color images to JPEG (optimize=true):

[VB.NET]
Public Shared Sub PackPdf(ByVal pdfFileName As String, ByVal optimize As Boolean)
    ' open PDF document to Read/Write
    Dim pdfDocument As New PdfDocument(pdfFileName)
    ' create PdfFormat - 1.6 format, with compressed coross-reference table
    Dim format As New PdfFormat("1.6", True, True)
    If optimize Then
        ' set JPEG Quality to 80
        PdfCompressionSettings.DefaultSettings.JpegQuality = 80
        ' create optimize settings
        ' compression for Color images - JPEG
        ' compression for B/W images - not change
        Dim optimizeSettings As New PdfOptimizeSettings(PdfCompression.Jpeg, PdfCompression.Undefined, PdfCompression.Undefined)
        ' compression for Data - not change
        ' optimize and Pack document
        pdfDocument.Optimize(format, optimizeSettings)
    Else
        ' pack document
        pdfDocument.Pack(format)
    End If
    ' free resources
    pdfDocument.Dispose()
End Sub

[C#]
public static void PackPdf(string pdfFileName, bool optimize)
{
    // open PDF document to Read/Write
    PdfDocument pdfDoument = new PdfDocument(pdfFileName);
    // create PdfFormat - 1.6 format, with compressed cross-reference table
    PdfFormat format = new PdfFormat("1.6", true, true);
    if (optimize)
    {
        // set JPEG Quality to 80
        PdfCompressionSettings.DefaultSettings.JpegQuality = 80;
        // create optimize settings
        PdfOptimizeSettings optimizeSettings = new PdfOptimizeSettings(
            PdfCompression.Jpeg,       //compression for Color images - JPEG
            PdfCompression.Undefined,  //compression for B/W images - not changed
            PdfCompression.Undefined); //compression for Data - not changed
        // optimize and Pack document
        pdfDoument.Optimize(format, optimizeSettings);
    }
    else
    {
        // pack document
        pdfDoument.Pack(format);
    }
    // free resources
    pdfDoument.Dispose();
}

 

 

What should I do when there is no font found?

Font search algorithm by default is as follows: the search starts in the directory $ASSEMBLY_DIRECTORY$\Fonts\, if there is no font found it begins to search the fonts installed in the system (information from the registry).

When the font was not found you should place it in the directory $ASSEMBLY_DIRECTORY$\Fonts\ or install to the system. You must also take into account that the search occur by the font's common name, not in PostScript style.

If you want redefine the font search algorithm, then you must create an implementation of IfontProgramsController interface or an inheritor from any implementation of this interface (SystemFontProgramsController, UserAndSystemFontProgramsController). After it is necessary to initialize property PDFDocument.FontProgramsController using an instance of created by you class.

 

 

How to convert PDF to TIFF?

Here is an example that shows how to convert PDF document to TIFF file using image collection and TiffEncoder:

[VB.NET]
Public Shared Sub ConvertPdfToTiff_1(ByVal pdfFileName As String, ByVal tiffFileName As String)
    ' create ImageCollection
    Dim imageCollection As New ImageCollection()
    ' add PDF document to collecion
    imageCollection.Add(pdfFileName)
    ' create TiffEncoder
    Dim tiffEncoder As New TiffEncoder(True)
    ' set TIFF compression to Zip
    tiffEncoder.Compression = TiffCompression.Zip
    ' save pages use TIFF encoder
    imageCollection.SaveSync(tiffFileName, tiffEncoder)
    ' free resources
    tiffEncoder.Dispose()
    imageCollection.Dispose()
End Sub

[C#]
public static void ConvertPdfToTiff_1(string pdfFileName, string tiffFileName)
{
    // create ImageCollection
    ImageCollection imageCollection = new ImageCollection();
    // add PDF document to collecion
    imageCollection.Add(pdfFileName);
    // create TiffEncoder
    TiffEncoder tiffEncoder = new TiffEncoder(true);
    // set TIFF compression to Zip
    tiffEncoder.Compression = TiffCompression.Zip;
    // save pages using TIFF encoder
    imageCollection.SaveSync(tiffFileName, tiffEncoder);
    // free resources
    tiffEncoder.Dispose();
    imageCollection.Dispose();
}

Here is an example that shows how to convert PDF document to TIFF file using PdfDocument and TiffFile:

[VB.NET]
Public Shared Sub ConvertPdfToTiff_2(ByVal pdfFileName As String, ByVal tiffFileName As String)
    ' open PDF document
    Dim pdfDocument As New PdfDocument(pdfFileName)
    ' create TIFF File
    Dim tiffFile As New TiffFile(tiffFileName, True)
    ' set TIFF compression to Zip
    tiffFile.Compression = TiffCompression.Zip
    ' foreach PDF pages
    For i As Integer = 0 To pdfDocument.Pages.Count - 1
        ' in TiffFile add rendered PDF page
        tiffFile.Pages.Add(pdfDocument.Pages(i).Render())
    Next
    ' free resources
    pdfDocument.Dispose()
    tiffFile.Dispose()
End Sub

[C#]
public static void ConvertPdfToTiff_2(string pdfFileName, string tiffFileName)
{
    // open PDF document
    PdfDocument pdfDocument = new PdfDocument(pdfFileName);
    // create TIFF File
    TiffFile tiffFile = new TiffFile(tiffFileName, true);
    // set TIFF compression to Zip
    tiffFile.Compression = TiffCompression.Zip;
    // for each PDF pages
    for (int i = 0; i < pdfDocument.Pages.Count; i++)
    {
        // add rendered PDF page to TiffFile
        tiffFile.Pages.Add(pdfDocument.Pages[i].Render());
    }
    // free resources
    pdfDocument.Dispose();
    tiffFile.Dispose();
}

 

 

How to convert PDF to TIFF with defined resolution (dpi)?

Here is an example that shows how to convert PDF document to TIFF file (with defined resolution and given drawing parameters) using image collection and PdfEncoder:

[VB.NET]
Public Shared Sub ConvertPdfToTiffDPI_1(ByVal pdfFileName As String, ByVal tiffFileName As String, ByVal dpi As Single)
    ' create ImageCollection    
    Dim imageCollection As New ImageCollection()
    ' set rendering settings
    imageCollection.RenderingSettings = New RenderingSettings(dpi, dpi,_
      System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear,_
      System.Drawing.Drawing2D.SmoothingMode.AntiAlias)
    ' add PDF document to collecion
    imageCollection.Add(pdfFileName)
    ' create TiffEncoder
    Dim tiffEncoder As New TiffEncoder(True)
    ' set TIFF compression to Zip
    tiffEncoder.Compression = TiffCompression.Zip
    ' save pages use TIFF encoder
    imageCollection.SaveSync(tiffFileName, tiffEncoder)
    ' free resources
    tiffEncoder.Dispose()
    imageCollection.Dispose()
End Sub

[C#]
public static void ConvertPdfToTiffDPI_1(string pdfFileName, string tiffFileName, float dpi)
{
    // create ImageCollection  
    ImageCollection imageCollection = new ImageCollection();
    // set rendering settings
    imageCollection.RenderingSettings = new RenderingSettings(
        dpi, 
        dpi, 
        System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear, 
        System.Drawing.Drawing2D.SmoothingMode.AntiAlias);
    // add PDF document to collecion
    imageCollection.Add(pdfFileName);
    // create TiffEncoder
    TiffEncoder tiffEncoder = new TiffEncoder(true);
    // set TIFF compression to Zip
    tiffEncoder.Compression = TiffCompression.Zip;
    // save pages using TIFF encoder
    imageCollection.SaveSync(tiffFileName, tiffEncoder);
    // free resources
    tiffEncoder.Dispose();
    imageCollection.Dispose();
}

Here is an example that shows how to convert PDF document to TIFF file (with defined resolution and given drawing parameters) using PdfDocument and TiffFile:

[VB.NET]
Public Shared Sub ConvertPdfToTiffDPI_2(ByVal pdfFileName As String, ByVal tiffFileName As String, ByVal dpi As Single)
    ' open PDF document
    Dim pdfDocument As New PdfDocument(pdfFileName)
    ' set resolution
    pdfDocument.RenderingSettings.Resolution = New Resolution(dpi, dpi)
    ' set rendering mode - optimal balance between rendering speed and rendering quality.
    pdfDocument.RenderingSettings.RenderingMode = PdfRenderingMode.Normal
    ' create TIFF File
    Dim tiffFile As New TiffFile(tiffFileName, True)
    ' set TIFF compression to Zip
    tiffFile.Compression = TiffCompression.Zip
    ' foreach PDF pages
    For i As Integer = 0 To pdfDocument.Pages.Count - 1
        ' in TiffFile add rendered PDF page
        tiffFile.Pages.Add(pdfDocument.Pages(i).Render())
    Next
    ' free resources
    pdfDocument.Dispose()
    tiffFile.Dispose()
End Sub

[C#]
public static void ConvertPdfToTiffDPI_2(string pdfFileName, string tiffFileName, float dpi)
{
    // open PDF document
    PdfDocument pdfDocument = new PdfDocument(pdfFileName);
    // set resolution
    pdfDocument.RenderingSettings.Resolution = new Resolution(dpi, dpi);
    // set rendering mode - optimal balance between rendering speed and rendering quality.
    pdfDocument.RenderingSettings.RenderingMode = PdfRenderingMode.Normal;
    // create TIFF File
    TiffFile tiffFile = new TiffFile(tiffFileName, true);
    // set TIFF compression to Zip
    tiffFile.Compression = TiffCompression.Zip;
    // for each PDF pages
    for (int i = 0; i < pdfDocument.Pages.Count; i++)
    {
        // add rendered PDF page to TiffFile
        tiffFile.Pages.Add(pdfDocument.Pages[i].Render());
    }
    // free resources
    pdfDocument.Dispose();
    tiffFile.Dispose();
}

 

 

How to convert TIFF to PDF?

Here is an example that shows how to convert TIFF file to PDF document using image collection and PdfEncoder:

[VB.NET]
Public Shared Sub ConvertTiffToPdf_1(ByVal tiffFileName As String, ByVal pdfFileName As String)
    ' create ImageCollection
    Dim imageCollection As New ImageCollection()
    ' add PDF document to collecion
    imageCollection.Add(tiffFileName)
    ' create TiffEncoder
    Dim pdfEncoder As New PdfEncoder(True)
    ' set PDF compression to Zip
    pdfEncoder.Settings.Compression = PdfImageCompression.Zip
    ' save pages use PDF encoder
    imageCollection.SaveSync(pdfFileName, pdfEncoder)
    ' free resources
    pdfEncoder.Dispose()
    imageCollection.Dispose()
End Sub

[C#]
public static void ConvertTiffToPdf_1(string tiffFileName, string pdfFileName)
{
    // create ImageCollection
    ImageCollection imageCollection = new ImageCollection();
    // add TIFF file to collecion
    imageCollection.Add(tiffFileName);
    // create TiffEncoder
    PdfEncoder pdfEncoder = new PdfEncoder(true);
    // set PDF compression to Zip
    pdfEncoder.Compression = PdfImageCompression.Zip;
    // save pages using PDF encoder
    imageCollection.SaveSync(pdfFileName, pdfEncoder);
    // free resources
    pdfEncoder.Dispose();
    imageCollection.Dispose();
}

Here is an example that shows how to convert TIFF file to PDF document using PdfDocument and TiffFile:

[VB.NET]
Public Shared Sub ConvertTiffToPdf_2(ByVal tiffFileName As String, ByVal pdfFileName As String)
    ' create TIFF File
    Dim tiffFile As New TiffFile(tiffFileName)
    ' create new PdfDocument, version 1.4
    Dim pdfDocument As New PdfDocument(pdfFileName, FileMode.Create, FileAccess.Write, PdfFormat.Pdf_14)
    ' foreach TIFF pages
    For i As Integer = 0 To tiffFile.Pages.Count - 1
        ' add TIFF page to PDF document
        pdfDocument.Pages.Add(tiffFile.Pages(i).GetImage().GetImage(), PdfCompression.Zip)
        ' drop changes to disk
        pdfDocument.SaveChanges()
    Next
    ' free resources
    pdfDocument.Dispose()
    tiffFile.Dispose()
End Sub

[C#]
public static void ConvertTiffToPdf_2(string tiffFileName, string pdfFileName)
{
    // create TIFF File
    TiffFile tiffFile = new TiffFile(tiffFileName);
    // create new PdfDocument, version 1.4
    PdfDocument pdfDocument = new PdfDocument(
        pdfFileName, 
        FileMode.Create, 
        FileAccess.Write, 
        PdfFormat.Pdf_14);
    // for each TIFF page
    for (int i = 0; i < tiffFile.Pages.Count; i++)
    {
        // add TIFF page to PDF document
        pdfDocument.Pages.Add(tiffFile.Pages[i].GetImage(), PdfCompression.Zip);
        // drop changes to disk
        pdfDocument.SaveChanges();
    }
    // free resources
    pdfDocument.Dispose();
    tiffFile.Dispose();
}

 

 

How to convert TIFF to PDF/A?

Here is an example that shows how to convert TIFF file to PDF/A document using image collection and PdfEncoder:

[VB.NET]
Public Shared Sub ConvertTiffToPdfA_1(ByVal tiffFileName As String, ByVal pdfFileName As String)
    ' create ImageCollection
    Dim imageCollection As New ImageCollection()
    ' add PDF document to collecion
    imageCollection.Add(pdfFileName)
    ' create TiffEncoder
    Dim pdfEncoder As New PdfEncoder(True)
    ' set PDF compression to Zip
    pdfEncoder.Settings.Compression = PdfImageCompression.Zip
    ' set PDF/A compatible
    pdfEncoder.Settings.PdfACompatible = True
    ' save pages use PDF encoder
    imageCollection.SaveSync(tiffFileName, pdfEncoder)
    ' free resources
    pdfEncoder.Dispose()
    imageCollection.Dispose()
End Sub

[C#]
public static void ConvertTiffToPdfA_1(string tiffFileName, string pdfFileName)
{
    // create ImageCollection
    ImageCollection imageCollection = new ImageCollection();
    // add PDF document to collection
    imageCollection.Add(pdfFileName);
    // create TiffEncoder
    PdfEncoder pdfEncoder = new PdfEncoder(true);
    // set PDF compression to Zip
    pdfEncoder.Compression = PdfImageCompression.Zip;
    // set PDF/A compatible
    pdfEncoder.PdfACompatible = true;
    // save pages using PDF encoder
    imageCollection.SaveSync(tiffFileName, pdfEncoder);
    // free resources
    pdfEncoder.Dispose();
    imageCollection.Dispose();
}

Here is an example that shows how to convert TIFF file to PDF/A document using PdfDocument and TiffFile:

[VB.NET]
Public Shared Sub ConvertTiffToPdfA_2(ByVal tiffFileName As String, ByVal pdfFileName As String)
    ' create TIFF File
    Dim tiffFile As New TiffFile(tiffFileName)
    ' create new PDF/A compatible PdfDocument
    Dim pdfDocument As New PdfDocument(pdfFileName, FileMode.Create, FileAccess.Write, PdfFormat.Pdf_A)
    ' foreach TIFF pages
    For i As Integer = 0 To tiffFile.Pages.Count - 1
        ' add TIFF page to PDF document
        pdfDocument.Pages.Add(tiffFile.Pages(i).GetImage().GetImage(), PdfCompression.Zip)
        ' drop changes to disk
        pdfDocument.SaveChanges()
    Next
    ' free resources
    pdfDocument.Dispose()
    tiffFile.Dispose()
End Sub

[C#]
public static void ConvertTiffToPdfA_2(string tiffFileName, string pdfFileName)
{
    // create TIFF File
    TiffFile tiffFile = new TiffFile(tiffFileName);
    // create new PDF/A compatible PdfDocument
    PdfDocument pdfDoument = new PdfDocument(
        pdfFileName, 
        FileMode.Create, 
        FileAccess.Write, 
        PdfFormat.Pdf_A);
    // for each TIFF page
    for (int i = 0; i < tiffFile.Pages.Count; i++)
    {
        // add TIFF page to PDF document
        pdfDocument.Pages.Add(tiffFile.Pages[i].GetImage(), PdfCompression.Zip);
        // drop changes to disk
        pdfDocument.SaveChanges();
    }
    // free resources
    pdfDocument.Dispose();
    tiffFile.Dispose();
}