Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ TestDocuments/Demo/_Output/
# Visual Studio 2017 auto generated files
Generated\ Files/

# MuPDF.NativeAssets generation files
MuPDF/packages

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
Expand Down
3 changes: 2 additions & 1 deletion Demo/Samples/Llm/Program.Llm.TableExtract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ internal static void TestTableExtract3()
internal static void TestOcr()
{
PdfExtractor.UseLayout = true;
PdfExtractor.ToMarkdown(@"..\..\..\..\TestDocuments\Demo\Ocr.pdf", useOcr: true, writeImages: false, embedImages: false);
string md = PdfExtractor.ToMarkdown(@"..\..\..\..\TestDocuments\Demo\Ocr.pdf", useOcr: true, writeImages: false, embedImages: false);
Console.WriteLine(md);
string text = PdfExtractor.ToText(@"..\..\..\..\TestDocuments\Demo\Ocr.pdf", useOcr: true);
Console.WriteLine(text);
}
Expand Down
11 changes: 5 additions & 6 deletions Demo/Samples/Regression/Program.Regression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,20 +201,19 @@ internal static void TestPixmapParallel()

internal static void TestGetTablesParallel()
{
const int iterations = 100;
const int degreeOfParallelism = 10;

string testFilePath = DemoPaths.Input("err_table.pdf");
if (!File.Exists(testFilePath))
{
Console.WriteLine($"Test file not found: {testFilePath}");
return;
}

const int iterations = 100;
const int degreeOfParallelism = 10;
int failures = 0;
long totalTables = 0;

Console.WriteLine("\n=== Parallel Utils.GetTables ===");
Console.WriteLine("Multi-thread Utils.GetTables test");
Console.WriteLine($"PDF: {testFilePath}");
Console.WriteLine($"Iterations: {iterations}");
Console.WriteLine($"Degree of parallelism: {degreeOfParallelism}");
Expand All @@ -238,12 +237,12 @@ internal static void TestGetTablesParallel()

Interlocked.Add(ref totalTables, tables.Count);
Console.WriteLine(
$"Iteration {iteration + 1} (thread {Environment.CurrentManagedThreadId}): {tables.Count} table(s)");
$"Iteration {iteration + 1} (thread {Environment.CurrentManagedThreadId}): {totalTables} table(s)");
}
catch (Exception ex)
{
Interlocked.Increment(ref failures);
Console.WriteLine($"Iteration {iteration + 1} FAILED: {ex}");
Console.WriteLine($"Iteration {iteration + 1} FAILED: {ex.Message}");
}
});

Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<Import Project="Versions.props" />
<Import Project="MuPDF\NativeAssets.Dev.props" Condition="Exists('$(MSBuildThisFileDirectory)MuPDF\NativeAssets.Dev.props')" />

<PropertyGroup>
<!-- NuGet packages may target newer TFMs than PDF4LLM multi-targets (net461–net7). -->
Expand Down
11 changes: 4 additions & 7 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,17 @@ namespace Artifex
/// &lt;summary&gt;Central version constants for the MuPDF.NET solution.&lt;/summary&gt;
public static class Versions
{
/// &lt;summary&gt;Native MuPDF library (FZ_VERSION).&lt;/summary&gt;
/// &lt;summary&gt;Native MuPDF library (FZ_VERSION / MuPDF.NativeAssets).&lt;/summary&gt;
public const string MuPDF = "$(ArtifexMuPDFVersion)"%3B

/// &lt;summary&gt;PyMuPDF Python package (VersionBind).&lt;/summary&gt;
public const string PyMuPDF = "$(ArtifexPyMuPDFVersion)"%3B

/// &lt;summary&gt;PyMuPDF4LLM Python package.&lt;/summary&gt;
public const string PyMuPDF4LLM = "$(ArtifexPyMuPDF4LLMVersion)"%3B

/// &lt;summary&gt;MuPDF.NET NuGet package.&lt;/summary&gt;
public const string MuPDFNet = "$(ArtifexMuPDFNetVersion)"%3B

/// &lt;summary&gt;PDF4LLM NuGet package.&lt;/summary&gt;
public const string PDF4LLM = "$(ArtifexPDF4LLMVersion)"%3B

/// &lt;summary&gt;pymupdf-layout PyPI package (PDF4LLM layout bridge).&lt;/summary&gt;
public const string PyMuPDFLayout = "$(ArtifexPyMuPDFLayoutVersion)"%3B
}
}
</_ArtifexVersionCs>
Expand Down
4 changes: 2 additions & 2 deletions MuPDF.Fonts/FontRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace MuPDF.Fonts
{
/// <summary>Font descriptor and buffer loaders generated from pymupdf-fonts sources.</summary>
/// <summary>Font descriptor and buffer loaders generated from bundled font sources.</summary>
public static class FontRegistry
{
/// <summary>One pymupdf-fonts descriptor entry.</summary>
/// <summary>One bundled font descriptor entry.</summary>
public sealed class Entry
{
/// <summary>True when the face is bold.</summary>
Expand Down
74 changes: 0 additions & 74 deletions MuPDF.NET.Test/Test4767.cs

This file was deleted.

2 changes: 1 addition & 1 deletion MuPDF.NET.Test/TestAnnots.cs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ public void test_richtext()
{
var bullet = $"{(char)0x2610}{(char)0x2611}{(char)0x2612}";
var text = $@"<p style=""text-align:justify;margin-top:-25px;"">
PyMuPDF <span style=""color: red;"">འདི་ ཡིག་ཆ་བཀྲམ་སྤེལ་གྱི་དོན་ལུ་ པའི་ཐོན་ཐུམ་སྒྲིལ་དྲག་ཤོས་དང་མགྱོགས་ཤོས་ཅིག་ཨིན།</span>
MuPDF.NET <span style=""color: red;"">འདི་ ཡིག་ཆ་བཀྲམ་སྤེལ་གྱི་དོན་ལུ་ པའི་ཐོན་ཐུམ་སྒྲིལ་དྲག་ཤོས་དང་མགྱོགས་ཤོས་ཅིག་ཨིན།</span>
<span style=""color:blue;"">Here is some <b>bold</b> and <i>italic</i> text, followed by <b><i>bold-italic</i></b>. Text-based check boxes: {bullet}.</span>
</p>";
var doc = new Document();
Expand Down
59 changes: 0 additions & 59 deletions MuPDF.NET.Test/TestDevInfrastructure.cs

This file was deleted.

48 changes: 0 additions & 48 deletions MuPDF.NET.Test/TestDocsSamples.cs

This file was deleted.

6 changes: 3 additions & 3 deletions MuPDF.NET.Test/TestFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private static string OptionalDocPath(string fileName) =>
[Fact]
public void test_font1()
{
const string text = "PyMuPDF";
const string text = "MuPDF.NET";
using var font = new Font("helv");
Assert.Equal("Helvetica", font.Name);
float tl = font.TextLength(text, fontSize: 20);
Expand Down Expand Up @@ -63,7 +63,7 @@ public void test_font1()
public void test_font2()
{
using var font = new Font("helv");
const string text = "PyMuPDF";
const string text = "MuPDF.NET";
Assert.Equal(font.TextLength(text), Utils.GetTextLength(text));
}

Expand All @@ -72,7 +72,7 @@ public void test_font2()
public void test_fontarchive()
{
var arch = new Archive();
string css = Utils.CssForPymupdfFont("notos", archive: arch, name: "sans-serif");
string css = Utils.CssForMupdfFont("notos", archive: arch, name: "sans-serif");
Console.WriteLine(css);
foreach (var entry in arch.EntryList)
Console.WriteLine($"fmt={entry.Fmt} entries={string.Join(", ", entry.Entries)} path={entry.Path}");
Expand Down
Loading