#[cfg(any(feature = "render", feature = "resident"))]
use std::path::Path;
use crate::EasyPdf;
#[cfg(feature = "markdown")]
use crate::{MarkdownProfile, ProcessorPipeline};
#[cfg(feature = "markdown-table")]
use crate::TableDetectorProcessor;
#[cfg(feature = "render")]
use crate::RenderError;
#[cfg(feature = "mcp")]
use crate::McpServer;
#[cfg(feature = "resident")]
use crate::ResidentClient;
impl EasyPdf {
#[must_use = "builder method"]
pub fn writer(title: impl Into<String>) -> crate::PdfWriterBuilder {
crate::PdfWriterBuilder::new(title)
}
#[cfg(feature = "markdown")]
#[must_use = "builder method"]
pub fn markdown_pipeline(profile: MarkdownProfile) -> ProcessorPipeline {
let _ = profile;
ProcessorPipeline::new()
}
#[cfg(feature = "markdown-table")]
#[must_use = "builder method"]
pub fn table_detector() -> TableDetectorProcessor {
TableDetectorProcessor::new()
}
#[cfg(feature = "render")]
pub fn render_page(
pdf_path: &Path,
page: usize,
output: &Path,
dpi: u32,
) -> std::result::Result<(), RenderError> {
easypdf_markdown::render::render_page_to_png(pdf_path, page, output, dpi)
}
#[cfg(feature = "mcp")]
#[must_use]
pub fn mcp_server() -> McpServer {
McpServer::new()
}
#[cfg(feature = "resident")]
pub fn serve(socket: Option<&Path>) -> std::result::Result<(), easypdf_runtime::resident::ResidentError> {
easypdf_runtime::resident::serve(socket)
}
#[cfg(feature = "resident")]
#[must_use]
pub fn attach() -> Option<ResidentClient> {
easypdf_runtime::resident::try_attach()
}
}