Giter VIP home page Giter VIP logo

imageprocessor.plugins.pdf's People

Contributors

dampee avatar mellson avatar tomvanenckevort avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

imageprocessor.plugins.pdf's Issues

PDF dpi

great plugin , just what i needed .
my only suggestion is to add a dpi parameter to the query string .
in my case the render of the pdf doesn't come out that well on low dpi

Seems like you need to have Ghostscript installed

I kept getting messages stating that Ghostscript couldn't find the installed version, so googled around a bit, and found a workaround, for when you don't have GS installed (http://ghostscriptnet.codeplex.com/discussions/465418).

I then implemented it in PdfRasterizer like this, and now it works like a charm. Not sure if this is a good way to go though.

        public PdfRasterizer(int xDpi = 96, int yDpi = 96)
        {
            _desiredXDpi = xDpi;
            _desiredYDpi = yDpi;

            _lastInstalledVersion = new GhostscriptVersionInfo(new System.Version(0, 0, 0), HttpContext.Current.Server.MapPath("~/bin/gsdll32.dll"), string.Empty, GhostscriptLicense.GPL);

            _rasterizer = new GhostscriptRasterizer();
        }

Render problem with layered PDF

Hello,
First, thank you for your work, so usefull!
And sorry for my english :)

We encounter a problem with a pdf containing layers. The resulted image contains only the above layer and fill the page with black. I can send it if it helps.
Thank you for your help.

32 bit IIS on a 64 bit machine

Currently, the check whether we run 32/64 bit is kind of wrong.

You could have a 64 bit machine, while IIS (or IIS Express) can be running in 32-bit. Which will cause an invalid result because we check on the machine: Environment.Is64BitProcess

I would be better if we checked on the current process whether it is 32 or 64 bit?

Looking for a solution, I came across this : https://stackoverflow.com/a/397695/97615

if (IntPtr.Size == 8) 
{
    // 64 bit machine
} 
else if (IntPtr.Size == 4) 
{
    // 32 bit machine
}

Page number is not in pages number range!

Just ran into your blogpost and awesome solution. Installed the plugin using NuGet, pulled the latest Ghostscript 9.50 (gsdll64.dll) assembly into the bin folder and used the following Razor to generate the image url: @Url.GetCropUrl(item, furtherOptions: "&format=jpg&width=500")

So far, so good but when viewing the image url, the following (not so good) exception is shown:

[GhostscriptException: Page number is not in pages number range!] Ghostscript.NET.Viewer.GhostscriptViewerPdfFormatHandler.InitPage(Int32 pageNumber) +206 Ghostscript.NET.Viewer.GhostscriptViewer.ShowPage(Int32 pageNumber, Boolean refresh) +160 Ghostscript.NET.Rasterizer.GhostscriptRasterizer.GetPage(Int32 xDpi, Int32 yDpi, Int32 pageNumber) +39 ImageProcessor.Plugins.Pdf.PdfRasterizer.Rasterize(Stream pdfStream, Int32 pageNumber) +54 ImageProcessor.ImageFactory.Load(Stream stream) +129 ImageProcessor.Web.HttpModules.<ProcessImageAsync>d__31.MoveNext() +4497 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60 System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) +64 System.Web.AsyncEventExecutionStep.InvokeEndHandler(IAsyncResult ar) +209 System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +156

I don't have a clue as to what to do with the page number. Have I missed something?

Preview content type is reported as PDF

When a generated PNG preview is generated it's content-type header is application/pdf where it should be image/png.

As a result of CORB, the importance of providing the correct content type has increased as images with an incorrect content type cannot be embedded into pages on external domains (i.e. if using a CDN).

NuGet Update

@dampee, any chance you can update the NuGet release. The "Use in memory version (#7)" commit is essential for this plugin and that's not in the current (1.2.0) NuGet package.

It's not hard to compile the source myself but it would be nice to be able to just include the NuGet package.

Otherwise, great work and thank you.

Geoff

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.