mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 09:21:57 +08:00
Try annotating various XmlSerializer related functions with RequiresUnreferencedCode
This commit is contained in:
parent
c2641b3ef6
commit
7d4789596e
@ -95,6 +95,9 @@
|
||||
/// </summary>
|
||||
/// <param name="document">The document to extract page layouts from.</param>
|
||||
/// <param name="includePaths">Draw PdfPaths present in the page.</param>
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode("Members from AltoDocument may be trimmed if not referenced directly")]
|
||||
#endif
|
||||
public string Get(PdfDocument document, bool includePaths = false)
|
||||
{
|
||||
var altoDocument = CreateAltoDocument("unknown");
|
||||
@ -106,6 +109,9 @@
|
||||
/// Get the Alto (XML) string of the page layout. Excludes <see cref="T:UglyToad.PdfPig.Geometry.PdfSubpath" />s.
|
||||
/// </summary>
|
||||
/// <param name="page">The page to export the XML layout for.</param>
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode("Members from PageXmlDocument may be trimmed if not referenced directly")]
|
||||
#endif
|
||||
public string Get(Page page) => Get(page, false);
|
||||
|
||||
/// <summary>
|
||||
@ -113,6 +119,9 @@
|
||||
/// </summary>
|
||||
/// <param name="page">The page to export the XML layout for.</param>
|
||||
/// <param name="includePaths">Whether the output should include the PdfPaths present in the page.</param>
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode("Members from AltoDocument may be trimmed if not referenced directly")]
|
||||
#endif
|
||||
public string Get(Page page, bool includePaths)
|
||||
{
|
||||
var document = CreateAltoDocument("unknown");
|
||||
@ -356,6 +365,9 @@
|
||||
};
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode("Members from AltoDocument may be trimmed if not referenced directly")]
|
||||
#endif
|
||||
private string Serialize(AltoDocument altoDocument)
|
||||
{
|
||||
var serializer = new XmlSerializer(typeof(AltoDocument));
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
using ReadingOrderDetector;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
@ -105,6 +106,9 @@
|
||||
/// Get the PAGE-XML (XML) string of the pages layout. Excludes PdfPaths.
|
||||
/// </summary>
|
||||
/// <param name="page"></param>
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode("Members from PageXmlDocument may be trimmed if not referenced directly")]
|
||||
#endif
|
||||
public string Get(Page page)
|
||||
{
|
||||
return Get(page, false);
|
||||
@ -115,6 +119,9 @@
|
||||
/// </summary>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="includePaths">Draw PdfPaths present in the page.</param>
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode("Members from PageXmlDocument may be trimmed if not referenced directly")]
|
||||
#endif
|
||||
public string Get(Page page, bool includePaths)
|
||||
{
|
||||
PageXmlData data = new PageXmlData();
|
||||
@ -373,6 +380,9 @@
|
||||
};
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode("Members from PageXmlDocument may be trimmed if not referenced directly")]
|
||||
#endif
|
||||
private string Serialize(PageXmlDocument pageXmlDocument)
|
||||
{
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(PageXmlDocument));
|
||||
@ -395,6 +405,9 @@
|
||||
/// <summary>
|
||||
/// Deserialize an <see cref="PageXmlDocument"/> from a given PAGE format XML document.
|
||||
/// </summary>
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode("Members from PageXmlDocument may be trimmed if not referenced directly")]
|
||||
#endif
|
||||
public static PageXmlDocument Deserialize(string xmlPath)
|
||||
{
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(PageXmlDocument));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user