Can not Print Out

PdfToPostScript_out-CANON-ERROR.z01.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z02.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z03.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z04.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z05.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z06.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z07.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z08.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z09.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z10.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z11.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z12.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z13.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z14.zip (5 MB)
PdfToPostScript_out-CANON-ERROR.z15.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.z16.zip (5 MB)

PdfToPostScript_out-CANON-ERROR.zip (1.9 MB)

I upload PostSCript FIle for CANON-PRINTER-ERROR

@hbhur102

Would you kindly share a bit more details like what code snippet are you using? So that we can test the scenario in our environment and address it accordingly.

                    Aspose.Pdf.Facades.PdfViewer viewer = new Aspose.Pdf.Facades.PdfViewer();

                    // Open input PDF file
                    viewer.BindPdf(dataDir2 + @"\" + name + "(수정)" + ext);

                    // Set attributes for printing
                    viewer.AutoResize = false;         // Print the file with adjusted size
                    viewer.AutoRotate = false;         // Print the file with adjusted rotation
                    viewer.PrintPageDialog = false;   // Do not produce the page number dialog when printing

                    // Create objects for printer and page settings and PrintDocument
                    //System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
                    //System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();

                    // Set printer name
                    //ps.PrinterName = prtdoc.PrinterSettings.PrinterName;

                    // Set PageSize (if required)
                    pgs.PaperSize = new Aspose.Pdf.Printing.PaperSize("A4", 827, 1169);

                    // Set PageMargins (if required)
                    pgs.Margins = new Aspose.Pdf.Devices.Margins(0, 0, 0, 0); 

                    label1.Text = "";

                    label1.Text = "[인쇄중" + "(" + i.ToString() + ")] " + name + "(수정)" + ext;
                    label1.Refresh();

                    //ps.PrintFileName = "PdfToPostScript_out.ps";
                    //ps.PrintToFile = true;

                    // ExStart:PrintDialog
                    if (i == 1)
                    {
                        System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog();
                        if (printDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            // Document printing code goes here
                            // Print document using printer and page settings
                            //ps = printDialog.PrinterSettings;
                            viewer.PrintDocumentWithSettings(pgs, ps);
                        }
                        else
                        {
                            Status = "CANCEL";
                            break;
                        }
                    }
                    else
                    {
                        viewer.PrintDocumentWithSettings(pgs, ps);
                    }

                    // Check the print status
                    if (viewer.PrintStatus != null)
                    {
                        // An exception was thrown
                        Exception ex = viewer.PrintStatus as Exception;

                        if (ex != null)
                        {
                            // Get exception message
                            MessageBox.Show(ex.Message);
                        }
                    }
                    else
                    {
                        // No errors were found. Printing job has completed successfully
                        Console.WriteLine("printing completed without any issue..");
                    }
                    //Print document using printer and page settings
                    //viewer.PrintDocumentWithSettings(pgs, ps);

                    // Close the PDF file after priting
                    viewer.Close();

System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();
pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0); // aspose.pdf 17.10 OK

Aspose.Pdf.Printing.PageSettings pgs = new Aspose.Pdf.Printing.PageSettings();
pgs.Margins = new Aspose.Pdf.Printing.Margins(0, 0, 0, 0); // aspose.pdf 23.4 error how can I do???

@hbhur102

System.Drawing.Printing.PrinterSettings was replaced with Aspose.Pdf.Printing.PrinterSettings starting from Aspose.PDF 23.10. This is made to support printing under Linux as well as under Windows.

public static void PrintingPDFFile()
{
    // Create PdfViewer object
    PdfViewer viewer = new PdfViewer();

    // Open input PDF file
    viewer.BindPdf(_dataDir + "sample.pdf");

    // Set attributes for printing
    viewer.AutoResize = true;         // Print the file with adjusted size
    viewer.AutoRotate = true;         // Print the file with adjusted rotation
    viewer.PrintPageDialog = false;   // Do not produce the page number dialog when printing

    // Create objects for printer and page settings and PrintDocument
    Aspose.Pdf.Printing.PrinterSettings ps = new Aspose.Pdf.Printing.PrinterSettings();
    Aspose.Pdf.Printing.PageSettings pgs = new Aspose.Pdf.Printing.PageSettings();
    System.Drawing.Printing.PrintDocument prtdoc = new System.Drawing.Printing.PrintDocument();

    // Set printer name
    ps.PrinterName = prtdoc.PrinterSettings.PrinterName;

    // Set PageSize (if required)
    pgs.PaperSize = new Aspose.Pdf.Printing.PaperSize("A4", 827, 1169);

    // Set PageMargins (if required)
    pgs.Margins = new Aspose.Pdf.Devices.Margins(0, 0, 0, 0);

    // Print document using printer and page settings
    viewer.PrintDocumentWithSettings(pgs, ps);

    // Close the PDF file after printing
    viewer.Close();
}
public static void PrintingPDFDisplayPrintDialog()
{
    // Create PdfViewer object
    PdfViewer viewer = new PdfViewer();

    // Open input PDF file
    viewer.BindPdf(_dataDir + "sample.pdf");

    // Set attributes for printing
    viewer.AutoResize = true;         // Print the file with adjusted size
    viewer.AutoRotate = true;         // Print the file with adjusted rotation

    // Create objects for printer and page settings and PrintDocument

    Aspose.Pdf.Printing.PageSettings pgs = new Aspose.Pdf.Printing.PageSettings
    {

        // Set PageSize (if required)
        PaperSize = new Aspose.Pdf.Printing.PaperSize("A4", 827, 1169),

        // Set PageMargins (if required)
        Margins = new Aspose.Pdf.Devices.Margins(0, 0, 0, 0)
    };

    System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog();
    if (printDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    {
        // Document printing code goes here
        // Print document using printer and page settings
        Aspose.Pdf.Printing.PrinterSettings ps = printDialog.PrinterSettings;
        viewer.PrintDocumentWithSettings(pgs, ps);
    }

    // Close the PDF file after priting
    viewer.Close();
}

Note: PrintDialog isn’t available in the NET Core Version 3.1 and later. Can it be invoked from Application.Current.Dispatcher.CurrentThread ? Check this.

public static void PrintingPDFToSoftPrinter()
{
    // Create PdfViewer object
    PdfViewer viewer = new PdfViewer();

    // Open input PDF file
    viewer.BindPdf(_dataDir + "sample.pdf");

    // Set attributes for printing
    viewer.AutoResize = true;         // Print the file with adjusted size
    viewer.AutoRotate = true;         // Print the file with adjusted rotation
    viewer.PrintPageDialog = false;   // Do not produce the page number dialog when printing

    viewer.PrintAsImage = false;

    // Create objects for printer and page settings and PrintDocument
    Aspose.Pdf.Printing.PrinterSettings ps = new Aspose.Pdf.Printing.PrinterSettings();
    Aspose.Pdf.Printing.PageSettings pgs = new Aspose.Pdf.Printing.PageSettings();

    // Set printer name
    //ps.PrinterName = "HP Universal Printing PS (v7.0.0)";
    // Or set the PDF printer
    ps.PrinterName = "Adobe PDF";

    // Set PageSize (if required)
    pgs.PaperSize = new Aspose.Pdf.Printing.PaperSize("A4", 827, 1169);

    // Set PageMargins (if required)
    pgs.Margins = new Aspose.Pdf.Devices.Margins(0, 0, 0, 0);

    // Print document using printer and page settings
    viewer.PrintDocumentWithSettings(pgs, ps);

    // Close the PDF file after priting
    viewer.Close();
}
public static void PrintingPDFHidePrintDialog()
{
    // Create PdfViewer object
    PdfViewer viewer = new PdfViewer();

    // Open input PDF file
    viewer.BindPdf(_dataDir + "sample.pdf");

    // Set attributes for printing
    viewer.AutoResize = true;         // Print the file with adjusted size
    viewer.AutoRotate = true;         // Print the file with adjusted rotation


    viewer.PrintPageDialog = false;   // Do not produce the page number dialog when printing

    // Create objects for printer and page settings and PrintDocument
    Aspose.Pdf.Printing.PrinterSettings ps = new Aspose.Pdf.Printing.PrinterSettings();
    Aspose.Pdf.Printing.PageSettings pgs = new Aspose.Pdf.Printing.PageSettings();

    // Set XPS/PDF printer name
    ps.PrinterName = "OneNote for Windows 10";

    // Set PageSize (if required)
    pgs.PaperSize = new Aspose.Pdf.Printing.PaperSize("A4", 827, 1169);

    // Set PageMargins (if required)
    pgs.Margins = new Aspose.Pdf.Devices.Margins(0, 0, 0, 0);

    // Print document using printer and page settings
    viewer.PrintDocumentWithSettings(pgs, ps);

    // Close the PDF file after priting
    viewer.Close();
}
public static void PrintingPDFasGrayscale()
{
    // Create PdfViewer object
    PdfViewer viewer = new PdfViewer();

    // Open input PDF file
    viewer.BindPdf(_dataDir + "sample.pdf");

    // Set attributes for printing
    viewer.AutoResize = true;         // Print the file with adjusted size
    viewer.AutoRotate = true;         // Print the file with adjusted rotation


    viewer.PrintPageDialog = false;   // Do not produce the page number dialog when printing
    viewer.PrintAsGrayscale = false;

    // Create objects for printer and page settings and PrintDocument
    Aspose.Pdf.Printing.PrinterSettings ps = new Aspose.Pdf.Printing.PrinterSettings();
    Aspose.Pdf.Printing.PageSettings pgs = new Aspose.Pdf.Printing.PageSettings();

    // Set XPS/PDF printer name
    ps.PrinterName = "OneNote for Windows 10";

    // Set PageSize (if required)
    pgs.PaperSize = new Aspose.Pdf.Printing.PaperSize("A4", 827, 1169);

    // Set PageMargins (if required)
    pgs.Margins = new Aspose.Pdf.Devices.Margins(0, 0, 0, 0);

    // Print document using printer and page settings
    viewer.PrintDocumentWithSettings(pgs, ps);

    // Close the PDF file after priting
    viewer.Close();
}
public static void CheckingPrintJobStatus()
{
    // Create PdfViewer object
    PdfViewer viewer = new PdfViewer();

    // Open input PDF file
    viewer.BindPdf(_dataDir + "sample1.pdf");

    // Set attributes for printing
    viewer.AutoResize = true;         // Print the file with adjusted size
    viewer.AutoRotate = true;         // Print the file with adjusted rotation
    viewer.PrintPageDialog = false;   // Do not produce the page number dialog when printing

    viewer.PrintAsImage = false;

    // Create objects for printer and page settings and PrintDocument
    Aspose.Pdf.Printing.PrinterSettings ps = new Aspose.Pdf.Printing.PrinterSettings();
    Aspose.Pdf.Printing.PageSettings pgs = new Aspose.Pdf.Printing.PageSettings();

    // Set XPS/PDF printer name
    ps.PrinterName = "HP Universal Printing PS (v7.0.0)";
    // Set output file name and PrintToFile attribute
    ps.PrintFileName = _dataDir + "PdfToPostScript_out.ps";
    ps.PrintToFile = true;

    // Set PageSize (if required)
    pgs.PaperSize = new Aspose.Pdf.Printing.PaperSize("A4", 827, 1169);

    // Set PageMargins (if required)
    pgs.Margins = new Aspose.Pdf.Devices.Margins(0, 0, 0, 0);

    // Print document using printer and page settings
    viewer.PrintDocumentWithSettings(pgs, ps);

    // Check the print status
    if (viewer.PrintStatus != null && viewer.PrintStatus is Exception ex)
    {
        Console.WriteLine(ex.Message);
    }
    else
    {
        // No errors were found. Printing job has been completed successfully
        Console.WriteLine("Printing completed without any issue..");
    }

    // Close the PDF file after printing
    viewer.Close();
}
struct PrintingJobSettings
{
    public int ToPage { get; set; }
    public int FromPage { get; set; }
    public string OutputFile { get; set; }
    public Aspose.Pdf.Printing.Duplex Mode { get; set; }
}

public static void PrintingPagesInSimplexAndDuplexMode()
{
    int printingJobIndex = 0;
    string inPdf = _dataDir + "sample-8page.pdf";
    string output = _dataDir;
    IList<PrintingJobSettings> printingJobs = new List<PrintingJobSettings>();

    PrintingJobSettings printingJob1 = new PrintingJobSettings
    {
        FromPage = 1,
        ToPage = 3,
        OutputFile = output + "sample_1_3.xps",
        Mode = Aspose.Pdf.Printing.Duplex.Default
    };

    printingJobs.Add(printingJob1);

    PrintingJobSettings printingJob2 = new PrintingJobSettings
    {
        FromPage = 4,
        ToPage = 6,
        OutputFile = output + "sample_4_6.xps",
        Mode = Aspose.Pdf.Printing.Duplex.Simplex
    };

    printingJobs.Add(printingJob2);

    PrintingJobSettings printingJob3 = new PrintingJobSettings
    {
        FromPage = 7,
        ToPage = 7,
        OutputFile = output + "sample_7.xps",
        Mode = Aspose.Pdf.Printing.Duplex.Default
    };

    printingJobs.Add(printingJob3);

    PdfViewer viewer = new PdfViewer();

    viewer.BindPdf(inPdf);
    viewer.AutoResize = true;
    viewer.AutoRotate = true;
    viewer.PrintPageDialog = false;

    Aspose.Pdf.Printing.PrinterSettings ps = new Aspose.Pdf.Printing.PrinterSettings();
    Aspose.Pdf.Printing.PageSettings pgs = new Aspose.Pdf.Printing.PageSettings();

    ps.PrinterName = "Microsoft XPS Document Writer";
    ps.PrintFileName = System.IO.Path.GetFullPath(printingJobs[printingJobIndex].OutputFile);
    ps.PrintToFile = true;
    ps.FromPage = printingJobs[printingJobIndex].FromPage;
    ps.ToPage = printingJobs[printingJobIndex].ToPage;



    ps.Duplex = printingJobs[printingJobIndex].Mode;
    ps.PrintRange = Aspose.Pdf.Printing.PrintRange.SomePages;

    pgs.PaperSize = new Aspose.Pdf.Printing.PaperSize("A4", 827, 1169);
    ps.DefaultPageSettings.PaperSize = pgs.PaperSize;
    pgs.Margins = new Aspose.Pdf.Devices.Margins(0, 0, 0, 0);

    viewer.EndPrint += (sender, args) =>
    {
        if (++printingJobIndex < printingJobs.Count)
        {
            ps.PrintFileName = System.IO.Path.GetFullPath(printingJobs[printingJobIndex].OutputFile);
            ps.FromPage = printingJobs[printingJobIndex].FromPage;
            ps.ToPage = printingJobs[printingJobIndex].ToPage;
            ps.Duplex = printingJobs[printingJobIndex].Mode;
            viewer.PrintDocumentWithSettings(pgs, ps);
        }
    };

    viewer.PrintDocumentWithSettings(pgs, ps);
}

Please let us know if using the latest version does not resolve your issue.

I used latest version 24.3

베데스다복음병원_118208_ko-KR_플래티넘 라이트 4.0_214_결과지 1(수정).pdf (8.1 MB)

베데스다복음병원_118208_ko-KR_플래티넘 라이트 4.0_214_결과지 2(수정).pdf (8.1 MB)

CANON-PS.zip (154.3 KB)

I Uploaded PDF and CANON PS FIle by your aspose.pdf.net 24.3

and this is the adobe acrobat prn files with CANON PRINTER

CANON.zip (129.6 KB)

@hbhur102

We are logging an investigation ticket since the issue looks related to the physical printer. Meanwhile, can you please share about the files that you shared above in multiple parts? Are you facing issue with those files as well?

Yes I can What kind of things do you want???

@hbhur102

I Uploaded PDF and CANON PS FIle by your aspose.pdf.net 24.3

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56869

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

How long are free support and paid support???

How much is paid support???

@hbhur102

In free support model, the issues are prioritized on a first come first serve basis. The resolution time of the issue depends upon the number of issues logged prior to it as well as the complexity and nature of the issue itself.

We request you please contact our Sales team by posting an inquiry in our Purchase forum where you will be provided with the required information.

About the files you shared above, would you please clarify how we can merge them to get one complete file? We are not sure which file is it. Is it output PostScript generated by the printer?

Can I solve the problem by Developer Paid Support???

How Can I buy paid Support???

I created a split compressed file and added the extension .zip to upload it. The Canon.prn file was printed using Acrobat on CanonPrinter.

@hbhur102

We are checking these details and will be getting back to you shortly.

I bought the paid support and open the ticket

@hbhur102

Can you please share the URL of the ticket that you opened in the paid support forum?