Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Extends Verify to allow verification of documents via Aspose.

License

Notifications You must be signed in to change notification settings

VerifyTests/Verify.Aspose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verify.Aspose

Discussions Build status NuGet Status

Extends Verify to allow verification of documents via Aspose.

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

See Milestones for release notes.

An Aspose License is required to use this tool.

Sponsors

Entity Framework Extensions

Entity Framework Extensions is a major sponsor and is proud to contribute to the development this project.

Entity Framework Extensions

NuGet

Usage

Enable Verify.Aspose

[ModuleInitializer]
public static void Initialize() =>
    VerifyAspose.Initialize();

snippet source | anchor

PDF

Verify a file

[Test]
public Task VerifyPdf() =>
    VerifyFile("sample.pdf");

snippet source | anchor

Verify a Stream

[Test]
public Task VerifyPdfStream()
{
    var stream = new MemoryStream(File.ReadAllBytes("sample.pdf"));
    return Verify(stream, "pdf");
}

snippet source | anchor

Result

{
  Pages: 2,
  AllowReusePageContent: false,
  CenterWindow: false,
  DisplayDocTitle: false,
  FitWindow: False,
  HideMenubar: False,
  HideToolBar: False,
  HideWindowUI: False,
  IgnoreCorruptedObjects: True,
  Info: {
    Creator: RAD PDF,
    Producer: RAD PDF 3.9.0.0 - http://www.radpdf.com
  },
  IsEncrypted: False,
  IsLinearized: False,
  IsPdfaCompliant: False,
  IsPdfUaCompliant: False,
  IsXrefGapsAllowed: True,
  OptimizeSize: False,
  PageLabels: {},
  PageLayout: Default,
  PdfFormat: v_1_4,
  Version: 1.4,
  Fonts: [
    Helvetica
  ],
  Text:

<a name="br1"></a>A Simple PDF File

This is a small demonstration .pdf file -

just for use in the Virtual Mechanics tutorials. More text. And more

text. And more text. And more text. And more text.

And more text. And more text. And more text. And more text. And more

text. And more text. Boring, zzzzz. And more text. And more text. And

more text. And more text. And more text. And more text. And more text.

And more text. And more text.

And more text. And more text. And more text. And more text. And more

text. And more text. And more text. Even more. Continued on page 2 ...





<a name="br2"></a> 

Simple PDF File 2

...continued from page 1. Yet more text. And more text. And more text.

And more text. And more text. And more text. And more text. And more

text. Oh, how boring typing this stuff. But not as boring as watching

paint dry. And more text. And more text. And more text. And more text.

Boring. More, a little more text. The end, and just as well.



}

snippet source | anchor

Samples.VerifyPdf#00.verified.png:

Excel

Verify a file

[Test]
public Task VerifyExcel() =>
    VerifyFile("sample.xlsx");

snippet source | anchor

Verify a Stream

[Test]
public Task VerifyExcelStream()
{
    var stream = new MemoryStream(File.ReadAllBytes("sample.xlsx"));
    return Verify(stream, "xlsx");
}

snippet source | anchor

Verify a WorkBook

[Test]
public Task VerifyWorkbook()
{
    var book = new Workbook
    {
        BuiltInDocumentProperties =
        {
            Comments = "the comments"
        }
    };
    book.CustomDocumentProperties.Add("key", "value");

    var sheet = book.Worksheets.Add("New Sheet");

    var cells = sheet.Cells;

    cells[0, 0].PutValue("Some Text");
    return Verify(book);
}

snippet source | anchor

Samples.VerifyExcel#Sheet1.verified.png:

Word

Verify a file

[Test]
public Task VerifyWord() =>
    VerifyFile("sample.docx");

snippet source | anchor

Verify a Stream

[Test]
public Task VerifyWordStream()
{
    var stream = new MemoryStream(File.ReadAllBytes("sample.docx"));
    return Verify(stream, "docx");
}

snippet source | anchor

Result

{
  HasRevisions: False,
  DefaultLocale: EnglishUS,
  Properties: {
    Characters: 1009,
    CharactersWithSpaces: 1183,
    CreateTime: DateTime_1,
    HeadingPairs: [
      Title,
      1
    ],
    LastSavedTime: DateTime_2,
    Lines: 8,
    Pages: 1,
    Paragraphs: 2,
    Template: Normal,
    Words: 176
  },
  CustomProperties: {
    ContentTypeId: 0x010100AA3F7D94069FF64A86F7DFF56D60E3BE
  },
  ShadeFormData: true,
  Fonts: [
    Consolas,
    Segoe UI,
    Symbol,
    Times New Roman,
    Trebuchet MS
  ],
  Text:
[Meeting name] meeting minutes

|Location:|[Address or room number]|
| :- | :- |
|Date:|[Date]|
|Time:|[Time]|
|Attendees:|[List attendees]|
# Agenda items
1. [It’s easy to make this template your own. To replace placeholder text, just select it and start typing. Don’t include space to the right or left of the characters in your selection.]
1. [Apply any text formatting you see in this template with just a click from the Home tab, in the Styles group. For example, this text uses the List Number style.]
1. [To add a new row at the end of the action items table, just click into the last cell in the last row and then press Tab.]
1. [To add a new row or column anywhere in a table, click in an adjacent row or column to the one you need and then, on the Table Tools Layout tab of the ribbon, click an Insert option.]
1. [Agenda item]
1. [Agenda item]

|<h1>Action items</h1>|<h1>Owner(s)</h1>|<h1>Deadline</h1>|<h1>Status</h1>|
| :- | :- | :- | :- |
|[Action item 1]|[Name(s) 1]|[Date 1]|[Status 1, such as In Progress or Complete]|
|[Action item 2]|[Name(s) 2]|[Date 2]|[Status 2]|
|[Action item 3]|[Name(s) 3]|[Date 3]|[Status 3]|
|[Action item 4]|[Name(s) 4]|[Date 4]|[Status 4]|
|[Action item 5]|[Name(s) 5]|[Date 5]|[Status 5]|
|[Action item 6]|[Name(s) 6]|[Date 6]|[Status 6]|

2

}

snippet source | anchor

Samples.VerifyWord#00.verified.png:

PowerPoint

Verify a file

[Test]
public Task VerifyPowerPoint() =>
    VerifyFile("sample.pptx");

snippet source | anchor

Verify a Stream

[Test]
public Task VerifyPowerPointStream()
{
    var stream = new MemoryStream(File.ReadAllBytes("sample.pptx"));
    return Verify(stream, "pptx");
}

snippet source | anchor

Result

{
  Properties: {
    NameOfApplication: Microsoft Office PowerPoint,
    Company: ,
    Manager: ,
    PresentationFormat: Custom,
    SharedDoc: false,
    ApplicationTemplate: ,
    Title: Lorem ipsum,
    Subject: ,
    Author: simon,
    Keywords: ,
    Comments: ,
    Category: ,
    CreatedTime: DateTime_1,
    LastSavedTime: DateTime_2,
    LastPrinted: DateTime_3,
    LastSavedBy: Simon Cropp,
    RevisionNumber: 1,
    ContentStatus: ,
    ContentType: ,
    HyperlinkBase: ,
    ScaleCrop: false,
    LinksUpToDate: false,
    HyperlinksChanged: false,
    Slides: 3,
    Notes: 3,
    Paragraphs: 14,
    Words: 231,
    TitlesOfParts: [
      Times New Roman,
      Arial,
      Droid Sans Fallback,
      WenQuanYi Zen Hei,
      DejaVu Sans,
      Office Theme,
      Office Theme,
      Lorem ipsum,
      Chart,
      Table
    ],
    HeadingPairs: [
      {
        Name: Fonts Used,
        Count: 5
      },
      {
        Name: Theme,
        Count: 2
      },
      {
        Name: Embedded OLE Servers
      },
      {
        Name: Slide Titles,
        Count: 3
      }
    ]
  },
  Fonts: [
    Arial,
    Calibri,
    Calibri Light,
    DejaVu Sans,
    Droid Sans Fallback,
    Times New Roman,
    WenQuanYi Zen Hei
  ]
}

snippet source | anchor

Samples.VerifyPowerPoint%2300.verified.png:

File Samples

http://file-examples.com/

Icon

Swirl designed by creativepriyanka from The Noun Project.

About

Extends Verify to allow verification of documents via Aspose.

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Contributors 4

  •  
  •  
  •  
  •