Coder Social home page Coder Social logo

pdflibcore's People

Contributors

jbaarssen avatar johncampionjr avatar kokenberg avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pdflibcore's Issues

MCG0037:InvalidCSharpIdentifierName Struct 'PdfLibCore.Types.FS_RECTF'

We get this when we're doing release builds for our Xamarin.Forms UWP app.

C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.12-rel-31116-00\tools\Microsoft.NetNative.targets(809,5): error : MCG0037: MCG0037:InvalidCSharpIdentifierName Struct 'PdfLibCore.Types.FS_RECTF' in assembly 'Assembly(Name=PdfLibCore, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null, Location=D:\...\ilc\in\PdfLibCore.dll)' has a field with name '<Left>k__BackingField' that is invalid. This could be because the name is obfuscated or the field is auto-implemented by the compiler. Please make sure the field name follows C# identifier conventions.

This might have some insight on how to fix the issue but I'm unclear how it would apply to PdfLibCore:
https://developercommunity.visualstudio.com/t/cant-build-release-code-mcg0037invalidcsharpidenti/526363#T-N529127

Thanks!

Attempted to read or write protected memory

I run PDF to image converter function in MulitTask as showed below
image

And some time [Attempted to read or write protected memory] error raised. I m sure that Not use duplicate Folder Path in img.Save() function.

PDFBug

cannot find bitmap.AsBmpStream method

in the PdfLibCore/src/ExampleApp/Program.cs :
//SaveToJpeg(bitmap.AsBmpStream(196D, 196D), Path.Combine(destination, $"{i++}.jpeg"));
I cannot find bitmap.AsBmpStream method.

how to change resolution?

                    using (var ms = new MemoryStream())
                    {
                        img.Save(ms, ImageFormat.Jpeg);

}

By default, storage is done with 96 dpi and the quality is not good. How can I change this default to 150 or 200 Dpi to experience better quality?

Crash when rendering a PDF to Image

In my WPF applicationn when I render PDF to image, I often have a crash :
PdfLibCore.PdfiumException: Tentative de lecture ou d'écriture de mémoire protégée. Cela indique souvent qu'une autre mémoire est endommagée. ---> System.AccessViolationException: Tentative de lecture ou d'écriture de mémoire protégée. Cela indique souvent qu'une autre mémoire est endommagée.
à PdfLibCore.Pdfium.PlatformInvoke.FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, Int32 start_x, Int32 start_y, Int32 size_x, Int32 size_y, PageOrientations rotate, RenderingFlags flags)
à PdfLibCore.Pdfium.FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, Int32 start_x, Int32 start_y, Int32 size_x, Int32 size_y, PageOrientations rotate, RenderingFlags flags)

For rendering, I use PdfiumBitmap :

var bitmap = new PdfiumBitmap(width, height, true);
pdfPage.Render(bitmap, pdfPage.Orientation, RenderingFlags.LcdText);

The crash occurs in Pdfium.cs, line 928 :

lock (Pdfium._lock)
{
try
{
Pdfium.PlatformInvoke.FPDF_RenderPageBitmap(bitmap, page, start_x, start_y, size_x, size_y, rotate, flags);
}
catch (AccessViolationException ex)
{
throw new PdfiumException((Exception) ex);
}
}

Add Support for iOS and Android

I tried to use the PdfCore library in a .NET MAUI App, and it worked only on Windows.
On Android and iOS the pdfium library is missing.
I tried to add the pdfium-binaries NuGet packages for iOS and Android in the PdfCore library but with no luck.
Can you help on this?

System.AccessViolationException:

Hi, I have a simple avalonia window where I load a multi page pdf and provide some simple navigation. I only show one page at a time so there's a button to load the next/previous page.

However after a few clicks to the next page I crash with a:
System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
from: pdfPage.Render(bitmap, PageOrientations.Normal, RenderingFlags.LcdText);

I'm using the newest 2.4 version of the plugin.

Warning:MSB3270

Hello

When I import the package using nuget, I will get a warning when compiling the project

MSB3270: The generated project's processor architecture "MSIL" does not match the processor architecture "AMD64" referencing PdfLibCore.dll". This mismatch may cause runtime failures. Consider changing your project's The target processor architecture to align the processor architecture between your project and the reference, or associate a reference with a processor architecture that matches your project's target processor architecture

targetFramework: net6, aspnetcore webapi

Please how should I handle this warning

Looking forward to your reply

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.