This project has moved and is read-only. For the latest updates, please go here.

MagickImage adds black line at top of image during svg to png/pdf conversation

Nov 26, 2015 at 7:12 AM
I'm trying convert my svg to png/pdf.
while doing so it add black strips on the image.
Attached is the sample pdf which shows the issue. if just convert it to png only that also has same issue.

Attached is the sample pdf file link:

//ToDo: Convert source SVG file to PDF, and update to dest folder.
                        string text = System.IO.File.ReadAllText(sourceFie);
                        byte[] bytes = Encoding.UTF8.GetBytes(text);
                        MagickNET.UseOpenCL = false;

                        MagickReadSettings settings = new MagickReadSettings()
                            Density = new PointD(3000, 3000),
                            ColorSpace= ColorSpace.RGB,
                            Format = MagickFormat.Svg

                        string pdfFileName = Path.ChangeExtension(destFileName, ".pdf");

                        using (MagickImage image = new MagickImage(bytes, settings))
                            image.ColorSpace = ColorSpace.RGB;
                            image.Format = MagickFormat.Pdf;
                            image.Density = new PointD(150, 150);
                            image.CompressionMethod = CompressionMethod.JPEG;
                            image.Resize(1240, 1753);
                            image.ResolutionUnits = Resolution.PixelsPerInch;
Nov 26, 2015 at 9:08 AM
What is your input image? And it looks like you are combining multiple images into one file?
Nov 26, 2015 at 9:23 AM
I'm trying to convert my svg file into PDF/PNG.
The one which you see is PDF file, which has Images and text alternatively
I do first convert the svg file into pdf and after all the svg's being converted finally i ll print the pdf with images an dtext alternatively.
Text pdf is nothing to do with this hence need not to be discussed over here.

Attaching the link to SVG. This is full svg. when we do send the we will break the svg into some protion, which comes correctly there is noting wrong into the given SVG portion.

This issue is not constantly producible.
Nov 26, 2015 at 9:55 AM
Are you using the latest version of Magick.NET?
Nov 26, 2015 at 10:00 AM

This is what i got from nuget manager.
Nov 26, 2015 at 10:20 AM
Can you update to the latest version and try to reproduce the issue?
Nov 27, 2015 at 4:43 AM
I've tried its same behavior. One more thing with its shows that Could not load file or assembly 'Magick.NET.Wrapper-x64.DLL which was not the case with .0019
Nov 27, 2015 at 10:12 AM
Edited Nov 27, 2015 at 10:12 AM
How can you test it if you get the message Could not load file or assembly 'Magick.NET.Wrapper-x64.DLL
Nov 30, 2015 at 4:09 PM
I cannot reproduce your issue with the latest version of Magick.NET. Can you upgrade to and try it again? You will need to install the Visual C++ Redistributable for Visual Studio 2015 for this version.
Dec 2, 2015 at 9:36 AM
what if i m using VS2013 not 2015, will it work? And do i need to install only in Dev machine or in deployment machine also i need to install anything?
Dec 2, 2015 at 10:15 AM
You can use it together with VS2013. You do need to install the C++ redistributable on all machines where you want to use Magick.NET.
Dec 3, 2015 at 9:10 AM
I have tried the new version as well. The new version Q16-AnyCpu not HDRI.
As proof i'm attaching the pdf page got generated after conversation. I'm not lying as you can check PDF properties and check for PDF producer which indicates the version and etc... and i got, this indicates its latest version. ImageMagick 7.0.0-0 Q16 x64 2015-11-23 means generated through latest version of the DLL.
Dec 3, 2015 at 9:56 AM
What is your Ghostscript version? Maybe this version has a bug? And why are you installing ImageMagick 7.0.0-0? You should not do that when you use Magick.NET.
Dec 3, 2015 at 10:03 AM
Image magick software is not installed. This file has been generated through the DLL only. Hence as producer its showing this text " ImageMagick 7.0.0-0 Q16 x64 2015-11-23".
Which ghost script you are talking about. i haven't manually installed anything in machine.
Where/how i can see that thing
Dec 3, 2015 at 11:22 AM
Sorry my bad, you only need Ghostscript to read PDF files.

Can you create a small project that demonstrates this issue and share it on something like DropBox? I am still unable to reproduce the issue.
Dec 10, 2015 at 6:22 AM
I have tried and about to send the sample project. But what i found when its part of my async method it behaves wired. When i applied the mutex on code where i do invoke the it worked fine.

So its taking time when multiple user access the same feature but it works, so problem is its not thread safe.
Dec 10, 2015 at 10:24 AM
The threading issue should be resolved in the latest version of Magick.NET. Are you using the same image with multiple threads? A single MagickImage is not thread safe.