{"action":"created","issue":{"url":"https://api.github.com/repos/dlemstra/Magick.NET/issues/347","repository_url":"https://api.github.com/repos/dlemstra/Magick.NET","labels_url":"https://api.github.com/repos/dlemstra/Magick.NET/issues/347/labels{/name}","comments_url":"https://api.github.com/repos/dlemstra/Magick.NET/issues/347/comments","events_url":"https://api.github.com/repos/dlemstra/Magick.NET/issues/347/events","html_url":"https://github.com/dlemstra/Magick.NET/issues/347","id":375544493,"node_id":"MDU6SXNzdWUzNzU1NDQ0OTM=","number":347,"title":"Exception when instantiating new MagickImageCollection by passing in PDF as a byte[]","user":{"login":"kljohnson2","id":13670806,"node_id":"MDQ6VXNlcjEzNjcwODA2","avatar_url":"https://avatars3.githubusercontent.com/u/13670806?v=4","gravatar_id":"","url":"https://api.github.com/users/kljohnson2","html_url":"https://github.com/kljohnson2","followers_url":"https://api.github.com/users/kljohnson2/followers","following_url":"https://api.github.com/users/kljohnson2/following{/other_user}","gists_url":"https://api.github.com/users/kljohnson2/gists{/gist_id}","starred_url":"https://api.github.com/users/kljohnson2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kljohnson2/subscriptions","organizations_url":"https://api.github.com/users/kljohnson2/orgs","repos_url":"https://api.github.com/users/kljohnson2/repos","events_url":"https://api.github.com/users/kljohnson2/events{/privacy}","received_events_url":"https://api.github.com/users/kljohnson2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-30T15:17:42Z","updated_at":"2018-10-30T15:54:45Z","closed_at":null,"author_association":"NONE","body":"### Prerequisites\r\n\r\n- [x] I have written a descriptive issue title\r\n- [x] I have verified that I am using the latest version of Magick.NET\r\n- [x] I have searched [open](https://github.com/dlemstra/Magick.NET/issues) and [closed](https://github.com/dlemstra/Magick.NET/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported\r\n\r\n### Description\r\nI'm trying to instantiate a new MagickImageCollection using a byte array, which should be an option from looking at the overloaded constructors. My goal is to convert a multi-page PDF into a collection of MagickImage objects, but I get the following error:\r\n```FailedToExecuteCommand `\\\"gswin32c.exe\\\" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 \\\"-sDEVICE=pngalpha\\\" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 \\\"-r300x300\\\"  \\\"-sOutputFile=C:/Users/KYLERJ~1.CIG/AppData/Local/Temp/magick-20604AaUhIVsEcWg%d\\\" \\\"-fC:/Users/KYLERJ~1.CIG/AppData/Local/Temp/magick-2060qx27_qu8fxBC\\\" \\\"-fC:/Users/KYLERJ~1.CIG/AppData/Local/Temp/magick-2060bh7xT1NnEmmm\\\"' (The system cannot find the file specified.\\r\\n) @ error/delegate.c/ExternalDelegateCommand/475```\r\n\r\nHere's my code:\r\n```\r\npublic void ConvertPDFToImages(byte[] pdfBytes, string saveImgToPath, string saveThumbnailToPath = null)\r\n        {\r\n            MagickReadSettings readSettings = new MagickReadSettings();\r\n            readSettings.Density = new Density(300, 300); // make this configurable\r\n            readSettings.Format = MagickFormat.Pdf;\r\n            using (MagickImageCollection images = new MagickImageCollection(pdfBytes, readSettings))\r\n            {\r\n                //images.Read(pdfBytes, settings);\r\n\r\n                for (int i = 0; i > images.Count; i++)\r\n                {\r\n                    int docNum = i + 1;\r\n                    string fullImgPath = FormatPath(saveImgToPath, docNum);\r\n                    string fullThumbPath = FormatPath(saveThumbnailToPath, docNum);\r\n\r\n                    _imageResizingService.OptimizeImage(images[0].ToByteArray(), fullImgPath, fullThumbPath);\r\n                }\r\n            }\r\n        }\r\n```\r\nI have tried passing the pdfBytes along with the readSettings into the constructor in the using statement as you see above as well as passing them into the `MagickImageCollection.Read()` method just inside of the using statement. I get the same error I included above.\r\n\r\n### Steps to Reproduce\r\n\r\n1. Create a sample PDF, go to a base64 encoder online and convert the sample PDF.\r\n2.  Get the byte[] from the base64 string by using the `Convert.FromBase64String()` method\r\n3. Set `MagickReadSettings.Format = MagickFormat.Pdf;`\r\n4. Try instantiating a new MagickImageCollection in a using statement as I did in the code snippet above.\r\n\r\n### System Configuration\r\nOS: Windows 10 Enterprise\r\nOS Version: 10.0.17134 Build 17134\r\nFramework: C# .Net Core 2.1.3\r\n\r\n- Magick.NET version: v7.9.0.1\r\n- Magick.NET-Q16-AnyCPU\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dlemstra/Magick.NET/issues/comments/434358422","html_url":"https://github.com/dlemstra/Magick.NET/issues/347#issuecomment-434358422","issue_url":"https://api.github.com/repos/dlemstra/Magick.NET/issues/347","id":434358422,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDM1ODQyMg==","user":{"login":"dlemstra","id":10426229,"node_id":"MDQ6VXNlcjEwNDI2MjI5","avatar_url":"https://avatars3.githubusercontent.com/u/10426229?v=4","gravatar_id":"","url":"https://api.github.com/users/dlemstra","html_url":"https://github.com/dlemstra","followers_url":"https://api.github.com/users/dlemstra/followers","following_url":"https://api.github.com/users/dlemstra/following{/other_user}","gists_url":"https://api.github.com/users/dlemstra/gists{/gist_id}","starred_url":"https://api.github.com/users/dlemstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlemstra/subscriptions","organizations_url":"https://api.github.com/users/dlemstra/orgs","repos_url":"https://api.github.com/users/dlemstra/repos","events_url":"https://api.github.com/users/dlemstra/events{/privacy}","received_events_url":"https://api.github.com/users/dlemstra/received_events","type":"User","site_admin":false},"created_at":"2018-10-30T15:54:45Z","updated_at":"2018-10-30T15:54:45Z","author_association":"OWNER","body":"A PDF file needs to have Ghostscript installed and you probably need to pay for it when you use it commercially. For most other image formats you don't need to install something."}}
{"actor":{"display_login":"dlemstra"}}