reliak / moonpdf Goto Github PK
View Code? Open in Web Editor NEWContains a WPF control for displaying PDF files and a sample PDF viewer, that uses this control
License: GNU General Public License v3.0
Contains a WPF control for displaying PDF files and a sample PDF viewer, that uses this control
License: GNU General Public License v3.0
Hi,
are there any way to load file from MVVM Model ?
Thanks,
Thomas
Hi I'm trying to build the solution with Visual Studio 2017 and .NET 4.6
At first I got error message regarding the headertemplate.json (Code 9009) and then I just removed everything from the build events.
After that I got another series of errors from the MoonPDF project when I tried again to build the solution:
Can somebody help me?
Why there is no ZoomToFit Method ?
If the width is greater than height , call ZoomToWidth , otherwise ZoomToHeight .
Is possible to add this method ?
Hello
how to add license.txt for using this repository: moonpdf
The license declaration as following shows:
Copyright (C) 2020 zhangdonglin12
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Am I right to using this declaration for my program ?
Looking forward for your reply. Thanks .
The source contained in this repository is different from the source where the code requests that we download the binaries from, i.e. on sourceforge at https://sourceforge.net/projects/moonpdf/files/. Which should be considered the latest source? Specifically for one example, the PdfLoaded event is FileLoaded at sourceforge. I'm not sure if there are other changes.
From sourceforge source for MoonPdfPanel.xaml.cs
if (this.FileLoaded != null)
this.FileLoaded(this, EventArgs.Empty);
From github
if (this.PdfLoaded != null)
this.PdfLoaded(this, EventArgs.Empty);
元素“MoonPdfLib.Virtualizing.CustomVirtualizingPanel”的布局测量覆盖不应将 PositiveInfinity 作为其 DesiredSize 返回,即使将 Infinity 作为可用大小传入
When I try to load some corrupted pdf file, app crashes with an exception:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at MoonPdfLib.MuPdf.MuPdfWrapper.NativeMethods.CountPages(IntPtr doc)
at MoonPdfLib.MuPdf.MuPdfWrapper.GetPageBounds(IPdfSource source, ImageRotation rotation, String password) at MoonPdfLib.MoonPdfPanel.LoadPdf(IPdfSource source, String password)
at MoonPdfLib.MoonPdfPanel.Open(IPdfSource source, String password)
at MoonPdfLib.MoonPdfPanel.OpenFile(String pdfFilename, String password)
It happens not often, but sometimes my app crashes on calling fz_run_page with System.AccessViolationException.
I cannot re-produce it, it happens occasionally on my client installations.
I guess the crashes are caused by the pinned but immediately un-pinned memory:
public PdfFileStream(IPdfSource source)
{
if (source is FileSource)
{
var fs = (FileSource)source;
Context = NativeMethods.NewContext(IntPtr.Zero, IntPtr.Zero, FZ_STORE_DEFAULT); // Creates the context
Stream = NativeMethods.OpenFile(Context, fs.Filename); // opens file as a stream
Document = NativeMethods.OpenDocumentStream(Context, ".pdf", Stream); // opens the document
}
else if (source is MemorySource)
{
var ms = (MemorySource)source;
Context = NativeMethods.NewContext(IntPtr.Zero, IntPtr.Zero, FZ_STORE_DEFAULT); // Creates the context
GCHandle pinnedArray = GCHandle.Alloc(ms.Bytes, GCHandleType.Pinned);
IntPtr pointer = pinnedArray.AddrOfPinnedObject();
Stream = NativeMethods.OpenStream(Context, pointer, ms.Bytes.Length); // opens file as a stream
Document = NativeMethods.OpenDocumentStream(Context, ".pdf", Stream); // opens the document
pinnedArray.Free();
}
}
I think pinnedArray must be an instance variable, and pinnedArray.Free() called in Dispose(), so the memory cannot get moved around by the garbage collector.
If you open a large and long (>250 pages) PDF, maximize the window, set zoom to fit width, grab the scroll bar and start to pull it down, not too slow nor too fast, you will get this error: "An unhandled exception of type 'System.OutOfMemoryException' occurred in PresentationCore.dll" at line 36 of BitmapExtensionMethods.cs.
i tried but i couldnt add dll.it give this error
a reference to could not be added. please make sure that the file is accessible ...
How can i solve this problem
which code is used for load pdf file?.. It want for learning purpose..
I am requesting if its possible to add pinch zoom for touch screen devices like a in a browser. My testing devices is a tecno winpad running windows 10 x86
Hi
When i ran build-all.msbuild in "VS Command Prompt 2010",i got the following error:
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or
corrupt [D:\Projects\z_Samples\1.WPF\PDF_Word\moonpdf\moonpdf-master\build-all.
msbuild]
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.
0\VC\BIN\link.exe"' : return code '0x463' [D:\Projects\z_Samples\1.WPF\PDF_Word
\moonpdf\moonpdf-master\build-all.msbuild]
Stop.
D:\Projects\z_Samples\1.WPF\PDF_Word\moonpdf\moonpdf-master\build-all.msbuild(1
7,3): error MSB3073: The command "nmake -f makefile-mupdf.msvc platform=X86" ex
ited with code 2.
Done Building Project "D:\Projects\z_Samples\1.WPF\PDF_Word\moonpdf\moonpdf-mas
ter\build-all.msbuild" (default targets) -- FAILED.
How can i resolve this issue?
Do you have any plans to add print functionality to the moonpdf library?
I call OpenFile
on the MoonPdfPanel and get the following exception:
An exception of type 'System.DllNotFoundException' occurred in MoonPdfLib.dll but was not handled in user code
Det gick inte att läsa in DLL-filen libmupdf.dll: Det går inte att hitta den angivna modulen. (Undantag från HRESULT: 0x8007007E)
vid MoonPdfLib.MuPdf.MuPdfWrapper.NativeMethods.NewContext(IntPtr alloc, IntPtr locks, UInt32 max_store)
vid MoonPdfLib.MuPdf.MuPdfWrapper.PdfFileStream..ctor(IPdfSource source)
vid MoonPdfLib.MuPdf.MuPdfWrapper.GetPageBounds(IPdfSource source, ImageRotation rotation, String password)
vid MoonPdfLib.MoonPdfPanel.LoadPdf(IPdfSource source, String password)
vid MoonPdfLib.MoonPdfPanel.Open(IPdfSource source, String password)
vid MoonPdfLib.MoonPdfPanel.OpenFile(String pdfFilename, String password)
I am using Nuget package version 0.3.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.