groege / pdfsharpcore Goto Github PK
View Code? Open in Web Editor NEWThis project forked from rocuh/pdfsharp.xamarin
PdfSharp port NetCore
This project forked from rocuh/pdfsharp.xamarin
PdfSharp port NetCore
MigraDoc renderer Fails when adding base64 image.
Fonts do not work yet.
When ever I try to add a Image my program always crash.
There is no difference if I use ImageSource or XImage and also if I use FromBinary,FromFile or FromStream. Everytime I get (nearly) the same Exception.
Object reference not set to an instance of an object.
In case of using ImageSource.FromBinary the next line is:
at MigraDocCore.DocumentObjectModel.MigraDoc.DocumentObjectModel.Shapes.ImageSource.FromBinary(String name, Func
1 imageSource, Nullable
1 quality)
Before opening the file I check if the file is existing with System.IO.File.Exists;
Im using .Net Core 2.0, with Visual Studio Community on Mac OS.
Would it make sense to upgrade to the latest ImageSharp library (and make it a dependency on the NuGet package instead)? It seems that there's been a lot of improvements/changes at SixLabors/ImageSharp.
I use PDFSharp.Xamarin.Forms in my app (Android and iOS). I initiated the package in MainActiviy.cs:
This works in general, but sometimes I get a strange error which causes my app to crash:
System.InvalidOperationException: PdfSharp.Xamarin.Forms already initialized before.
This happens at random during the use of my app.
PfdSharpCore throws a SystemNullReferenceException when I try to render a document that has had encryption enabled via the PdfSecuritySettings.DocumentSecurityLevel setting.
Stack trace points at
PdfSharpCore.Pdf.Security.PdfStandardSecurityHandler.ComputeOwnerKey(Byte[] userPad, Byte[] ownerPad, Boolean strongEncryption)
for 128 bit encryption, and
PdfSharpCore.Pdf.Security.PdfStandardSecurityHandler.PrepareRC4Key(Byte[] key, Int32 offset, Int32 length)
for 40 bit encryption (1 level deeper).
Project is a UWP application targeting Windows 10.
Is there any pre-configuration that is required (similar to Fonts) for document encryption, or is this an issue that merits investigation?
Thanks.
Tried to open a pdf document (template) to write on, however, by giving it the string path, it returns null - testpdf returns 0.
Using a filestream, testpdf gives 15 (version 1.5 of pdf, I assume) hover opening it with a filestream gives Unable to cast object of type 'PdfSharpCore.Pdf.PdfInteger' to type 'System.IConvertible'.
I really would like to write on a template pdf :)
Apologies as this is most likely because I can't figure out how to implement it properly.
In a migradoc table, attempting to add an image:
row.Cells[13].AddImage("image-name.png");
// cannot convert from string to IImageSource
and
ImageSource.ImageSourceImpl = new UwpImageSource(); // Is this what you meant??
IImageSource img = ImageSource.FromFile("image-name.png");
row.Cells[13].AddImage(img);
// throws error System.AggregateException
Otherwise your port has been extremely useful to me and I am able to create very complex documents. Thank you for sharing!
hi
I am new to UWP development and might be implementing it incorrectly but when I call document.save I seem to get an unauthorized access exception every time. I have not had time to look at the library code in detail yet.
Thank you for your efforts in rewriting the PdfSharp library!
It seems that the PdfSharpCore version available on nuget is far behind what's available on this repo (the nuget package points to https://github.com/ststeiger/PdfSharpCore). For instance PdfSharpCore.ImageSharp does not seem to be available.
Do you plan to publish this to nuget?
Below code piece does not works in UWP platform:
page.DrawRoundedRectangle(new XPen(XColors.Black, 2), new XRect(10, 10, 100, 100), new XSize(5, 5));
I'm not sure whether I'm doing anything wrong, or it's PdfSharpCore issue, but I'm unable to pass world's simplest JPG->PDF case.
Please anyone take a look at https://stackoverflow.com/questions/50961076/pdfsharpcore-image-rendering-issue
I think the FontResolver-stuff creates some lining issues for text in paragraphs in table cells.
What I get using your assemblies (VerticalAlignment.Top, then .Bottom, then .Center) -
Take a close look on the letter "g":
What I get using the same document creation code using original MigraDoc/PdfSharp (without FontResolver ofc):
Is this an issue I can fix on my side or is there generally some issue with the IFontResolver?
Thanks a lot for your work on this!
I'm trying to use MigraDoc following your Example and using following NuGet package https://preview.nuget.org/packages/PdfSharpCore.
The NuGet package seems to be missing MigraDocCore.Rendering. Is it an "official" package, or an uncoordinated activity of someone else?
Linebreak currently only works on Spaces, Hyphens and Soft-Hyphens.
If there aren't any of those characters the word should still be fit into the width.
I want to convert html to pdf. How to acheive it with this library.
PdfGenerator
class from PdfSharp
seems to be missing.
Hello, we are trying to use PdfSharp to fill a pdf document. It's working fine except when we need to fill comb type field.
When we fill them, they appear wrongly, each character are next to another like if it wasn't a comb field. Like in this image
When we click on the field it appear the right way :
From what I found during my search, you need to specifiy the right value for the property "/Ff" for a field to be a comb. This value is correctly fill on our field. Here are all its properties :
.
And here is how we fill the field with our text :
(pdfDocument.AcroForm.Fields["D1A_naissance"] as PdfTextField).Text = "10061939";
I'm realy lost, any help would be usefull !
I use the current PDFSharpCore from Nuget on Monodevelop targeting dotnet core 2.1.
My question is how to place a picture in the pdf.
Current way based on PDFSharp is:
DrawImage(graph, "whatever.gif", 730, 30, 72, 36);
public static void DrawImage(XGraphics gfx, string jpegSamplePath, int x, int y, int width, int height)
{
XImage image = XImage.FromFile(jpegSamplePath);
gfx.DrawImage(image, x, y, width, height);
}
How is this done in PDFSharpCore?
How to install PDFSharp.Xamarin.Forms library in my xamarin.forms 3.1 (.net standard 2.0) project. I dont found any nuget link....
Remove unnecessary code parts
Saving a View with Images is not working on Android
myDocument.Save() -> exception
myImage.AsJpeg() -> exception
myImage.AsBitmap() -> works
PDFsharp 1.50.5147
PdfSharp.Xamarin.Forms 1.0.0
System.NullReferenceException: Object reference not set to an instance of an object. at PdfSharp.Xamarin.Forms.Droid.AndroidImageSourceImpl.SaveAsJpeg (System.IO.MemoryStream ms) [0x00045] in E:\My Xamarin plugin\PdfSharp.Xamarin.Forms\PdfSharp.Xamarin.Forms\PdfSharp.Xamarin.Forms.Android\AndroidImageSourceImpl.cs:111 at PdfSharpCore.Drawing.XImage.AsJpeg () [0x00006] in <11413e5833e04920b85b1578e479c930>: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.