Welcome Guest Search | Active Topics | Sign In | Register

Print not working on x86 system Options
4insiders Handels + IT AG
Posted: Friday, June 16, 2023 4:37:35 AM
Rank: Newbie
Groups: Member

Joined: 11/3/2016
Posts: 3
Hello

We have updated our system from .NET 4.8 to .NET6.
eo.pdf we use the nuget with the version 23.2.34.
We build our WPF application with the platform target: Any CPU.

Now, when we publish our WPF application with clickonce (Configuration: Release, Target Framework: .net6.0-windows, Target Runtime: win-x86) we have the following problem:

We load a local PDF-file like this: PdfDocument document = new(filePath);
Now we want to print it synchronously: document.Print(settings).WaitOne();

It works on a 64bit machine but nothing happens on a 32bit machine. You can run this code multiple times and nothing happens, no printing, no exception just the task runs forever.

4insiders Handels + IT AG
Posted: Friday, June 16, 2023 9:28:22 AM
Rank: Newbie
Groups: Member

Joined: 11/3/2016
Posts: 3
Update: it works with the old eo.pdf nuget version: 20.0.81, so if you can publish a fix for the new eo.pdf nuget versions it would be great :)
eo_support
Posted: Monday, June 19, 2023 11:04:04 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

This appears to be a crash in the browser engine and for some reason the print task did not get properly canceled when the crash occurs. If this is the case, we will need to find the root of the crash as well as making sure the task gets properly canceled. In order to find the root of the crash, can you capture our internal running log and send it to us? You can follow these steps:

1. Run your print code and wait for a while (when it hangs);
2. Start DebugTools.exe, then select Tools -> Collect Logs from the main menu;
3. It should automatically lists your app name, you can then click "Collect Logs";
4. Once the log appears in the text box, click "Save and Submit" to save the log to a file;
5. Send the file to us in zip format (you can do so through our contact us page);

Once we have that we will look into it and see what we can find. In the mean time, we will work on our end to resolve the second issue (task not canceled when the browser engine crashes).

Thanks!
eo_support
Posted: Tuesday, June 20, 2023 11:41:33 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

We have received the log you sent to us. However the contents of the log does not show any indication that document.Print has every been called. Instead the log is similar to log generated by the following test code:

Code: C#
EO.Pdf.Runtime.AddLicense(your_license_key);
var doc = new PdfDocument();
doc.Pages.Add();
doc.Save(test_empty_pdf_file);


The above code simply creates an empty PDF file and verify your license key, this code generates a few lines of logs that is almost identical to the log you sent to us. On the other hand, if PdfDocument.Print has indeed been called, the logs would contain a lot more entries --- which do not exist in the log you sent to us. So please double check whether the function indeed has been called. Or you can create a minium console app that just call that function and send us updated logs.

Thanks!
4insiders Handels + IT AG
Posted: Thursday, June 22, 2023 2:59:36 AM
Rank: Newbie
Groups: Member

Joined: 11/3/2016
Posts: 3
In this small WPF project we only have this method that needs eo.pdf. In this method we see the output of the line BEFORE printing, but nothing AFTER the line.

Code: C#
private void SendToPrinter(string filePath)
        {
            Runtime.AddLicense(...);

            if (File.Exists(filePath))
            {
                try
                {
                    PdfDocument document = new(filePath);
                    PrinterSettings settings = new();
                    settings.PrinterName = this.MainPrinterName;

                    if (!string.IsNullOrWhiteSpace(settings.PrinterName))
                    {
                        if (this.IsPrintingEnabled)
                        {
                            this.WriteEventLog("Document Sent to Printer " + settings.PrinterName);
                            document.Print(settings).WaitOne();
                            this.WriteEventLog("Document printed.");
                        }
                        else
                        {
                            ...
                        }

                        ...
                    }
                    else
                    {
                        ...
                    }
                }
                catch (Exception exception)
                {
                    ...
                }
            }
            else
            {
                ...
            }
        }


Because of this I don't see the effort for a console project, but if you don't find out anything else, I can try it in 2 weeks after my vacation.
eo_support
Posted: Saturday, June 24, 2023 1:07:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

When you say 32 bit machine, do you mean 32 bit Windows? Our latest version only runs on 64 bit Windows. However it should still produce log entries. We have a separate build that runs on 32 bit Windows.

Thanks!



You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.