News Category

Spire.PDF 8.9 (Spire.Pdf.dll 8.9.16) supports setting the zoom type of bookmarks to Brought forward

2022-09-30 08:58:43

We are glad to announce the release of Spire.PDF 8.9. This version supports setting the zoom type of bookmarks to Brought forward, and supports setting the zoom type of hyperlinks to Brought forward, as well as supports adding digital signatures with pictures. In addition, it fixes some known issues such as the text position was incorrect after printing PDF. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New feature SPIREPDF-5462 Supports setting the zoom type of bookmarks to Brought forward.
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(inputFile);
            PdfBookmarkCollection bookmarks = pdf.Bookmarks;
            for(int i = 0; i<bookmarks.Count; i++)
            {
                PdfBookmark bookmark = bookmarks[i];
SetBookmarkAction(bookmark);
            }
            pdf.SaveToFile(outputFile, FileFormat.PDF);

  private void SetBookmarkAction(PdfBookmark bookmark)
{
    PdfDestination dest = bookmark.Destination;
    dest.Mode = PdfDestinationMode.Location;
    dest.Zoom = 0;
    for (int i = 0; i < bookmark.Count; i++)
    {
        PdfBookmark childbookmark = bookmark[i];
        SetBookmarkAction(childbookmark);
    }
}
New feature SPIREPDF-5461 Supports setting the zoom type of hyperlinks to Brought forward.
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(inputFile);
            PdfAnnotationCollection annotations = pdf.Pages[0].AnnotationsWidget;
            for(int i = 0; i<annotations.Count; i++)
            {
                PdfDocumentLinkAnnotationWidget anno = annotations[i] as PdfDocumentLinkAnnotationWidget;
PdfDestination dest = anno.Destination;
dest.Mode = PdfDestinationMode.Location;
                dest.Zoom = 0;
                anno.Destination = dest;
            }
            pdf.SaveToFile(outputFile, FileFormat.PDF);
            pdf.Close();
New feature SPIREPDF-1126 Supports adding digital signatures with pictures.
static void Main(string[] args)
{

    PdfDocument doc = new PdfDocument();
    doc.LoadFromFile(@"test.pdf");
    PdfPageBase pagebase = doc.Pages[0];
    X509Certificate2 x509 = new X509Certificate2(@"gary.pfx", "e-iceblue");
    PdfOrdinarySignatureMaker signatureMaker = new PdfOrdinarySignatureMaker(doc, x509);
    IPdfSignatureAppearance signatureAppearance = new PdfCustomSignatureAppearance();
    signatureMaker.MakeSignature("Signature", signatureAppearance);
    doc.SaveToFile(@"new.pdf", Spire.Pdf.FileFormat.PDF);
    doc.Close();
}
public class PdfCustomSignatureAppearance : IPdfSignatureAppearance
{
    public void Generate(PdfCanvas g)
    {
        Image image = Image.FromFile("test.png");
        g.DrawImage(PdfImage.FromImage(image), new PointF(0, 0));
    }
}
Bug SPIREPDF-892 Fixes the issue that the DashDot line effect was incorrect after converting PDF to image.
Bug SPIREPDF-1121 Fixes the issue that the text position was incorrect after printing PDF.
Bug SPIREPDF-1125 Fixes the issue that there was an error when opening the PDF file which was filled the image field.
Bug SPIREPDF-4485 Fixes the issue that it failed to replace text in form field.
Bug SPIREPDF-5439 Fixes the issue that the extracted table content was incorrect.
Bug SPIREPDF-5441 Fixes the issue that the application threw System.ArgumentException when extracting table.
Bug SPIREPDF-5444 Fixes the issue that there was an error when opening the created PDF file with an image by Preview tool in MacOS12.5.
Bug SPIREPDF-5456 Fixes the issue that the program threw an error"Invalid date string, after year" when calling pdf.SaveToFile(file) in the German language system.
Bug SPIREPDF-5466 Fixes the issue that English letters on geometry were missing when converting PDF to image
Bug SPIREPDF-5467 Fixes the issue that the content was missing when converting PDF to image.
Click the link to download Spire.PDF 8.9
More information of Spire.PDF new release or hotfix: