Spire.PDF 3.9.360 supports to print the specific page on the PDF

Spire.PDF

We are pleased to announce a new hotfix version-Spire.PDF 3.9.360 today. In this version, we add new features to print the specific page and expose the name property of the layer. We also do some adjustments for the print function, the PDF layer and the PDF security feature. We also focus on fixing the bugs especially for the conversion from PDF to XPS, image to PDF and the compression the images in PDF file. Viewing the following full description of its enhanced features:

New Features:

  • Support to print specific page.
  • PdfDocument doc = new PdfDocument();
    doc.LoadFromFile(filename);
    doc.PrintSettings.SelectSomePages(new int[]{2,4});
    doc.Print();
    
  • Expose the name property of the layer.
  • string name = doc.Layers[0].Name;
    
  • Support to set the alignment for the signature content.
  • signature.SignTextAlignment=SignTextAlignment.Right;
    
  • Support to get the text by document structure.
  • PdfDocument doc = new PdfDocument();
    doc.LoadFromFile("Alcontrol - EDF.pdf");
    PdfPageBase page = doc.Pages[0];
    SimpleTextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
    string text = page.ExtractText(strategy);
    FileStream fs = new FileStream("Alcontrol - EDF.txt", FileMode.Create);
    StreamWriter sw = new StreamWriter(fs);
    sw.Write(text);
    sw.Flush();
    

Adjustments:

  • The PrintDocument object has been marked as obsolete, it only needs to set the PrintSettings when print. Example:
  • PdfDocument doc = new PdfDocument(FilePath + "sample.pdf");
    //change print settings you want
    doc.PrintSettings.Landscape = true;
    doc.Print();
    
  • The pageLayers object of Page has been marked as obsolete, use Layers object under PdfDocument instead. It must create the Graphics for the Layer with the CreateGraphics method when Add Layer. Example:/li>
    //add layer
    PdfLayer layer = doc.Layers.AddLayer("red line", PdfVisibility.On);
    PdfCanvas pcA = layer.CreateGraphics(doc.Pages[0].Canvas);
    pcA.DrawLine(new PdfPen(PdfBrushes.Red, 1), new PointF(0, 100), new PointF(100, 100));
    layer = doc.Layers.AddLayer("blue line");
    PdfCanvas pcB = layer.CreateGraphics(doc.Pages[0].Canvas);
    pcB.DrawLine(new PdfPen(PdfBrushes.Blue, 1), new PointF(0, 150), new PointF(100, 150));
    //remove the layer by name
    doc.Layers.RemoveLayer(("red line"));
    

Bug solutions:

  • Fixes the issue that cannot delete layer.
  • Fixes the issue that caused the character wrong after deleting image.
  • Fixes the issue that the image cannot be deleted.
  • Fixes the issue that caused NullReferenceException when flatten form field.
  • Fixes the issue that the checkboxField is not checked after setting checkboxField.Checked as true.
  • Fixes the issue that caused content missing after replacing image.
  • Fixes the issue that caused the content in invisible region shows after creating Booklet.
  • Fixes the issue that caused the original content changed when appending a new page.
  • Fixes the issue that the object cloned from PdfDocument returns null.
  • Fixes the issue that caused the size of document increased after compressing images.
  • Fixes the issue that caused the background changed to black when converting PDF to XPS.
  • Fixes the issue that the size of document grows too much when converting image to pdf.
  • Fixes the issue that caused spot colors setting in image missing when drawing image to PDF.
  • Fixes the issue that custom properties don't work.
  • Fixes the issue that cannot delete custom properties.
  • Fixes the issue that caused small drilling holes missing when printing the PDF.
  • Fixes the issue that custom properties missing after setting own password.

Get the most recent version of Spire.PDF 3.9.360 here:
More information of Spire.PDF new release or hotfix: