Spire.PDF 10.11.7 supports returning an array of region values for PdfTextMarkupAnnotationWidget

Spire.PDF 10.11.7 supports returning an array of region values for PdfTextMarkupAnnotationWidget

2024-11-29 09:54:53

We are delighted to announce the release of Spire.PDF 10.11.7. This version supports returning an array of region values for PdfTextMarkupAnnotationWidget. It also enhances the conversion from PDF to images and Markdown and SVG to PDF. Besides, many known issues are fixed successfully in this version, such as the issue that the content was incorrect when printing PDF documents. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New feature SPIREPDF-7135 Supports returning an array of region values for PdfTextMarkupAnnotationWidget.
// Create a PdfDocument object
PdfDocument doc = new PdfDocument();           
// Load a PDF file
doc.LoadFromFile(inputFile);            
// Initialize a StringBuilder to store extracted text
StringWriter highlightedTextWriter = new StringWriter();           
// Loop through each page in the document
foreach (PdfPageBase page in doc.Pages)
{
	// Get all annotations on the page
	PdfAnnotationCollection annotations = page.Annotations;                
	// Loop through the annotations
	foreach (PdfAnnotation annotation in annotations)
	{
		// Check if the annotation is a highlight annotation
		if (annotation is PdfTextMarkupAnnotationWidget highlightAnnotation)
		{
			if (highlightAnnotation.TextMarkupAnnotationType == PdfTextMarkupAnnotationType.Highlight)
			{
				PdfBrush brush = PdfBrushes.Red;
				PdfPen pen = new PdfPen(brush, 1f);                          
				for (int i = 0;i<highlightAnnotation.QuadPoints.Length;i += 2) {
					page.Canvas.DrawLine(pen, highlightAnnotation.QuadPoints[i], highlightAnnotation.QuadPoints[i + 1]);
				}
				
			}
		}
	}
}            
doc.SaveToFile(outputFile);
Bug SPIREPDF-7049 Fixed the issue that the program threw an "ArgumentException" error when converting XPS to PDF.
Bug SPIREPDF-7125
SPIREPDF-7156
Fix the issue that the content is displayed incompletely after converting SVG to PDF.
Bug SPIREPDF-7147 Fix the issue that the signature verification was not correct.
Bug SPIREPDF-7172 Fix the issue that the content was lost after converting PDF to images.
Bug SPIREPDF-7178 Fix the issue that the program threw an "ObjectDisposedException" error when converting PDF to Markdown.
Bug SPIREPDF-7183 Fixed the issue that the content was incorrect when printing PDF documents.
Click the link to download Spire.PDF 10.11.7:
More information of Spire.PDF new release or hotfix: