Skip to content

Make classes related to page content parsing public#1065

Merged
BobLd merged 1 commit intoUglyToad:masterfrom
BobLd:page-content-parser-ctor
Jun 28, 2025
Merged

Make classes related to page content parsing public#1065
BobLd merged 1 commit intoUglyToad:masterfrom
BobLd:page-content-parser-ctor

Conversation

@BobLd
Copy link
Copy Markdown
Collaborator

@BobLd BobLd commented Jun 28, 2025

The goal is to let BasePageFactory<T> decide the IPageContentParser implementation.

You can provide the IPageContentParser implementation as follow:

public sealed class PageFactoryWithoutIPageContentParser : BasePageFactory<int>
{
	public PageFactoryWithoutIPageContentParser(
		IPdfTokenScanner pdfScanner,
		IResourceStore resourceStore,
		ILookupFilterProvider filterProvider,
		IPageContentParser _, // Not in use
		ParsingOptions parsingOptions)
		: base(pdfScanner,
			resourceStore,
			filterProvider,
			new PageContentParser(ReflectionGraphicsStateOperationFactory.Instance, parsingOptions.UseLenientParsing), // Instantiate yours here
			parsingOptions)
	{
		if (PageContentParser is null)
		{
			throw new ArgumentNullException(nameof(PageContentParser));
		}
	}

	[...]
}

@BobLd BobLd force-pushed the page-content-parser-ctor branch from 9442fa2 to f4190d0 Compare June 28, 2025 12:08
@BobLd BobLd changed the title Handle TPageFactory ctor with no IPageContentParser parameter Make classes related to page content parsing public Jun 28, 2025
@BobLd BobLd merged commit 73ce5bb into UglyToad:master Jun 28, 2025
2 checks passed
@BobLd BobLd deleted the page-content-parser-ctor branch June 28, 2025 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant