Extends Verify to allow verification of documents via GrapeCity Documents.
Перейти к файлу
Simon Cropp c1ddf67ac6 refs 2022-03-10 06:23:50 +11:00
.github Update on-push-do-docs.yml 2022-02-04 21:09:56 +11:00
src refs 2022-03-10 06:23:50 +11:00
.gitignore . 2022-03-04 22:07:57 +11:00
code_of_conduct.md . 2021-11-17 12:23:55 +11:00
license.txt . 2021-11-17 12:23:55 +11:00
readme.md Update readme.md 2022-02-08 13:08:14 +11:00

readme.md

Verify.GrapeCity

Build status NuGet Status

Extends Verify to allow verification of documents via GrapeCity Documents API.

Converts documents (pdf, docx, and xslx) to png for verification.

An GrapeCity License is required to use this tool.

NuGet package

https://nuget.org/packages/Verify.GrapeCity/

Usage

Enable Verify.GrapeCity

using VerifyTests;

public static class ModuleInitializer
{
    [ModuleInitializer]
    public static void Initialize()
    {
        VerifyGrapeCity.Initialize();
    }
}

snippet source | anchor

PDF

Verify a file

[Test]
public Task VerifyPdf()
{
    return Verifier.VerifyFile("sample.pdf");
}

snippet source | anchor

Verify a Stream

[Test]
public Task VerifyPdfStream()
{
    return Verifier.Verify(File.OpenRead("sample.pdf"))
        .UseExtension("pdf");
}

snippet source | anchor

Result

{
  Title: ,
  Author: ,
  CreationDate: DateTimeOffset_1,
  ModifyDate: DateTimeOffset_2,
  Subject: ,
  Keywords: ,
  Creator: RAD PDF,
  Producer: RAD PDF 3.9.0.0 - http://www.radpdf.com
}

snippet source | anchor

Samples.VerifyPdf.01.verified.png:

Excel

Verify a file

[Test]
public Task VerifyExcel()
{
    return Verifier.VerifyFile("sample.xlsx");
}

snippet source | anchor

Verify a Stream

[Test]
public Task VerifyExcelStream()
{
    return Verifier.Verify(File.OpenRead("sample.xlsx"))
        .UseExtension("xlsx");
}

snippet source | anchor

Result

{
  BuiltInDocumentProperties: {},
  CustomDocumentProperties: {},
  DefaultTableStyle: TableStyleMedium2,
  EnableCalculation: true
}

snippet source | anchor

Samples.VerifyExcel.01.verified.png:

Word

Verify a file

[Test]
public Task VerifyWord()
{
    return Verifier.VerifyFile("sample.docx");
}

snippet source | anchor

Verify a Stream

[Test]
public Task VerifyWordStream()
{
    return Verifier.Verify(File.OpenRead("sample.docx"))
        .UseExtension("docx");
}

snippet source | anchor

Result

{
  Pages: 1,
  ApplicationName: Microsoft Office Word,
  AplicationVersion: 16.0,
  Company: ,
  CreatedTime: DateTime_1,
  Language: en-US,
  Security: None,
  RevisionNumber: 3,
  DefaultFont: Liberation Serif
}

snippet source | anchor

Samples.VerifyWord.01.verified.png:

File Samples

http://file-examples.com/

Icon

Grapes designed by Ale Em from The Noun Project.