GithubHelp home page GithubHelp logo

doccou's Introduction

Doccou

A simple free and open source app to count document pages from anywhere. Drag and drop any number of pdfs, docxs to the app to display the total amount of page.

Demo

Demo Doccou alpha

Support

Pdf Docx Pptx Doc Odt ePub DjVu Image
Pdf Page Count x
Homemade script x
AnyCount x x x x x x x
Doccou x x x x x

Versus

Free GUI FOSS Lib PCL
Pdf Page Count x x x
Homemade script x x
AnyCount x
Doccou x x x x x

Feature Done

v1.2.0

  • Add Sample
  • Add Unit Tests
  • Add image support
  • Add pptx support

v1.1.0

  • Add multithreading
  • Add .odt support

v1.0.0

  • Move to OOP
  • Add .pdf support
  • Add gui
  • Add .docx support
  • Move to MVVM

Bug Reports & Feature Requests

You can help by reporting bugs, suggesting features, reviewing feature specifications or just by sharing your opinion.

Use GitHub Issues for all of that.

Contributing

  1. Fork the project.
  2. Create a branch for your new feature.
  3. Write tests.
  4. Write code to make the tests pass.
  5. Submit a pull request.

All pull requests are welcome !

License

CountPages uses the MIT license. See LICENSE for more details.

doccou's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

doccou's Issues

Add Image support

If a user add an image, we can read it as a document with one page.
What do you think? Is it helpful?

Move to Mahapps

I already work with Mahapps and I love it. I think about add it to CountPages (I really dislike this name. An alternativ ? see #1).

You can learn more about Mahapps at mahapps.com or at their github.

Move the PCL in a different project

Today, CountPages is powered by the lib Counter. Counter is a PCL (Portable Class Library). Should I move Counter in another repository? What is the best way to split one repository into two? Should I create an organization?

Move to a better name

CountPages is generic and boring. I dont really like it.
Any idea of a new name ?

Add DjVu support

DjVu is a computer file format designed primarily to store scanned documents, especially those containing a combination of text, line drawings, indexed color images, and photographs. [...] DjVu has been promoted as an alternative to PDF, promising smaller files than PDF for most scanned documents.

source Wikipedia

We support PDF, why not an open source alternative?

more info about DjVu on their official website.

Add documentation

It would be useful if CountPages's wiki was used.

We could add a "How to use" page, a faq page, etc.

Should I use Inheritance, Composition or an extension method?

During the development of the library Counter, I face an pattern problem. Some documents are archives. Pdf is not. Docx is. Odt is. You can unzip it to read what is inside.
To access to the number of a document's page, I had to.

My class Docx can read an archive. I added to Docx a private method ReadArchive(). Odt can read an archive. I decided to move my method to an extension method. It works. Fine we can move on. Well we could.

  • I don't want to extend anything.
  • Helpers are not really great from an OOP view point.
  • Extension methods can bring some troubles [FR].

Archivist throwing documents

Well, what can I do? I think about two alternatives. I could use Inheritance or Composition. Lets see some code and some logic.

Helper

internal sealed class Doc : ADocument
{
    public Doc(Stream stream)
    {
        string content = Counter.Documents.Helper.Archivist.ReadArchive(stream);
        // do stuff with content like extract the page's count.
    }
}

I, as a document, ask an Archivist to read an archive for me.

Composition

internal sealed class Doc : ADocument
{
    private static readonly Archivist Archivist = new Archivist();

    public Doc(Stream stream)
    {
        string content = Archivist.ReadArchive(stream);
        // do stuff with content like extract the page's count.
    }
}

I, as a document, own an Archivist to read an archive for me.

Inheritance

internal sealed class Doc : ADocument, Archivist
{
    public Doc(Stream stream)
    {
        string content = ReadArchive(stream);
        // do stuff with content like extract the page's count.
    }
}

I, as a document, am also an Archivist. I know how to read an archive.

Multiple inheritance is considered armful. I can understand why (post about this), but not in this case. Can you enlight me?

We cant use multiple inheritance in C#, but we can simulate it. I don't want to add complexity to this project and I dot want to use an antipattern.

I am going to move to the composition pattern. In this case, should I?

Add a visual summary file by file on the window

It could be a list or a group of list like a small treeview.

For example :

6 Documents 20 pages
4 PDF
- toto1.pdf 1 pages
- toto2.pdf 4 pages
- toto3.pdf 6 pages
- toto4.pdf 4 pages
2 Docx
- toto1.docx 3 pages
- toto1.docx 4 pages

What do you think ?

Why can't I check if a directory or a file?

Hello,

During the developement of the feature which allow to drag and drop a directory (see #15), I faced a behavior that I couldnt understand.

I wrote two snippets who check if a path is a directory or a file. Any of them worked the way I think they would work.

First one:

if (!Directory.Exists(path))
{
}

Second one:

if (!File.GetAttributes(path).HasFlag(FileAttributes.Directory))
{
}

Finally I fixed it with a hack-feel solution, I checked if the path contains a extension or not. This hack will not work with a file without an extension. I can't keep that.

You can see the problem here.

Any idea?

Add epub support

It could be nice to support the epub support. If someone want to count the number of pages of a group of ebook, CountPages could be useful.

Add a constructor to Document to handle stream by himself

Something like this would be great :

public Document(string fullName)
{
    // convert fullName to stream and do stuff
}

We could use PCL Storage but it seems that they didnt implement the code needed for portable class. I tried this :

private static async Task<Stream> OpenAsync(string fullName)
{
    var file = await FileSystem.Current.GetFileFromPathAsync(fullName);
    return await file.OpenAsync(FileAccess.Read);
}

I will look into it later. If someone knows an alternative, I am listening.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.