Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converter returns empty byte array on ubuntu #162

Open
b-nanovski opened this issue Jul 7, 2022 · 0 comments
Open

Converter returns empty byte array on ubuntu #162

b-nanovski opened this issue Jul 7, 2022 · 0 comments

Comments

@b-nanovski
Copy link

b-nanovski commented Jul 7, 2022

Hi,

I am using DinkToPdf to convert a webpage into a PDF. I use the following code:

var converter = new SynchronizedConverter(new PdfTools());

            var doc = new HtmlToPdfDocument()
            {
                GlobalSettings =
                {
                    ColorMode = ColorMode.Color,
                    Orientation = Orientation.Portrait,
                    PaperSize = PaperKind.A4,
                    Margins = new MarginSettings() { Top = 10 },
                },
                Objects = {
                    new ObjectSettings()
                    {
                        Page = "https://en.wikipedia.org/wiki/Main_Page",
                    },
                }
            };

            try
            {
                byte[] pdf = converter.Convert(doc);
                FileResult fileResult = new FileContentResult(pdf, "application/pdf")
                {
                    FileDownloadName = "wikipedia_main_page.pdf"
                };

                return fileResult;
            }
            catch (Exception e)
            {
                return JsonConvert.SerializeObject(e);
            }

On Windows it works fine and returns a PDF properly.
After I deploy to an ubuntu Apache server it also runs, but the Convert() method returns a byte[] that is empty. No error is thrown, no nothing.

I am using the proper native libraries - for Windows (the .dll file) and for Ubuntu (the .os or .dylib file - I don't know exactly which one it is, I copy all of them).

Any ideas why that would be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant