2018-01-11 03:49:32 +08:00
|
|
|
|
namespace UglyToad.PdfPig
|
2017-11-10 03:14:09 +08:00
|
|
|
|
{
|
2019-12-20 23:11:05 +08:00
|
|
|
|
using System.Collections.Generic;
|
2017-11-10 03:14:09 +08:00
|
|
|
|
using Logging;
|
|
|
|
|
|
2018-01-07 20:37:48 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Configures options used by the parser when reading PDF documents.
|
|
|
|
|
/// </summary>
|
2017-11-10 03:14:09 +08:00
|
|
|
|
public class ParsingOptions
|
|
|
|
|
{
|
2019-08-11 19:41:51 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// A default <see cref="ParsingOptions"/> with <see cref="UseLenientParsing"/> set to false.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static ParsingOptions LenientParsingOff { get; } = new ParsingOptions
|
|
|
|
|
{
|
|
|
|
|
UseLenientParsing = false
|
|
|
|
|
};
|
|
|
|
|
|
2018-01-07 20:37:48 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Should the parser ignore issues where the document does not conform to the PDF specification?
|
|
|
|
|
/// </summary>
|
2017-11-10 03:14:09 +08:00
|
|
|
|
public bool UseLenientParsing { get; set; } = true;
|
|
|
|
|
|
2018-01-07 20:37:48 +08:00
|
|
|
|
private ILog logger = new NoOpLog();
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The <see cref="ILog"/> used to record messages raised by the parsing process.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ILog Logger
|
|
|
|
|
{
|
|
|
|
|
get => logger ?? new NoOpLog();
|
|
|
|
|
set => logger = value;
|
|
|
|
|
}
|
2019-05-10 02:02:39 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2019-12-20 23:11:05 +08:00
|
|
|
|
/// The password to use to open the document if it is encrypted. If you need to supply multiple passwords to test against
|
|
|
|
|
/// you can use <see cref="Passwords"/>. The value of <see cref="Password"/> will be included in the list to test against.
|
2019-05-10 02:02:39 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
public string Password { get; set; } = string.Empty;
|
2019-12-20 23:11:05 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// All passwords to try when opening this document, will include any values set for <see cref="Password"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<string> Passwords { get; set; } = new List<string>();
|
2017-11-10 03:14:09 +08:00
|
|
|
|
}
|
|
|
|
|
}
|