Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Nov 28, 2024 8:23 am

I have an issue that bold chinese characters in the pdf became very thick when printed out using java.print(). I am using commercial spire.pdf for java. How do I reduce the thickness of the words?

java version 1.8.421
os version windows 11

Code: Select all
PdfDocument pdf = new PdfDocument();
        pdf.loadFromFile('test_file');

        // Get the printer service
        PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
        PrintService selectedService = null;
        for (PrintService service : services) {
            if (service.getName().equals(printerName)) {
                selectedService = service;
                break;
            }
        }

        if (selectedService != null) {
            // Print the document to the selected printer
            try {
                PrinterJob job = PrinterJob.getPrinterJob();
                job.setPrintService(selectedService);
                PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
                attributes.add(new Copies(1));//number of copies
                attributes.add(OrientationRequested.PORTRAIT);//page orientation
                attributes.add(MediaSizeName.ISO_A4);//page size
                attributes.add(Chromaticity.COLOR);//color or mono
                attributes.add(SheetCollate.UNCOLLATED);//collate or no collate
                attributes.add(Sides.DUPLEX);//single page or double page
                PageFormat pageFormat = (PageFormat) job.getPageFormat(attributes).clone();

                Paper paper = pageFormat.getPaper();
                paper.setImageableArea(0, 0, paper.getWidth(), paper.getHeight());
                pageFormat.setPaper(paper);
                job.setPrintable(pdf, pageFormat);
                job.print(attributes);
            } catch (Exception e) {
                e.printStackTrace();
            }

chenyongli
 
Posts: 10
Joined: Thu Nov 28, 2024 3:25 am

Thu Nov 28, 2024 10:01 am

Hello,

Thank you for inquiry.
I tested the printing of your document using our latest version of PDF and did encounter the issue you described. I have logged this problem in our bug tracking system with the reference number SPIREPDF-7233. Our development team will investigate and fix it, and I will keep you updated once it is resolved.
However, the print output on my side is not exactly the same as yours. I have attached my test results from the virtual printer below for your reference. The results from my physical printer align with the virtual print.
Please note that when printing, you need to install all the fonts used in the PDF file (on Windows 11, right-click the font file and select "Install for all users"). Otherwise, our product may use other fonts as substitutes, which could also lead to the issue you described. Additionally, physical printers may also cause printing discrepancies. It is recommended to use the "Microsoft XPS Document Writer" virtual printer and our latest version of Spire.PDF to test again.

Spire.PDF 10.10.7: https://www.e-iceblue.com/Download/pdf-for-java.html

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Fri Nov 29, 2024 1:25 am

I am already using the latest spire.pdf 10.10.7, but the result is still the same. May I know how long the fix will be? I need it urgently.

chenyongli
 
Posts: 10
Joined: Thu Nov 28, 2024 3:25 am

Fri Nov 29, 2024 2:16 am

Hi,

I'm sorry, as this issue was only raised yesterday, it will take some time for our development team to investigate. Therefore, we are currently unable to provide a specific timeline for a fix. However, we have escalated your issue to the highest priority, and we will keep you informed as soon as there are any meaningful progresses.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Fri Nov 29, 2024 6:16 am

Hi Doris,

Thanks for the quick reply. I have another test file that only have embedded fonts showing the same issue as well. So I guess it's not really a system font issue. It's just for your information, hope it helps with the investigation. Let me know if there is any update. Thanks.

chenyongli
 
Posts: 10
Joined: Thu Nov 28, 2024 3:25 am

Fri Nov 29, 2024 8:50 am

Hi,

Thank you for your additional file.
I tested the new file and indeed encountered the issue you mentioned. I have submitted it to our development team. Our developers will investigate it as soon as possible. Once there's any progress, I will inform you ASAP.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Mon Dec 02, 2024 5:36 am

Hello,

Our development team has addressed the issue of the print bolding becoming thicker in your first file and is now proceeding to the testing phase. We will inform you promptly once the testing is completed and approved. However, upon investigating the second file you provided, our development team found that the text within is in a path format. Unfortunately, our product is not capable of processing this type of format. We apologize for any inconvenience this may cause.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Wed Dec 04, 2024 6:41 am

Hi Doris,

Thanks for the update, may I know when the fix will come out?

chenyongli
 
Posts: 10
Joined: Thu Nov 28, 2024 3:25 am

Wed Dec 04, 2024 8:06 am

Hi,

Sorry, this issue is still awaiting testing currently, and the release date is not determined yet. If you need it urgently, I can help you apply for a temporary version to use (which has not been tested). Please let me know if you require this.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Fri Dec 06, 2024 1:05 am

Hi Doris,

Yes, please help me apply a temporary version. Thanks.

chenyongli
 
Posts: 10
Joined: Thu Nov 28, 2024 3:25 am

Fri Dec 06, 2024 10:25 am

Hello,

I have already requested a temporary version for you. However, adjustments to this issue may have significant impacts. In order for you to use it better, we need to conduct a more comprehensive test first. Once the test is successfully passed, we will immediately provide you with the temporary version.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Mon Dec 16, 2024 11:06 am

Hi Doris,

May I know when will the temporary version testing done?

chenyongli
 
Posts: 10
Joined: Thu Nov 28, 2024 3:25 am

Tue Dec 17, 2024 10:03 am

Hi,

I apologize for the delay in providing this, as we made further adjustments and conducted additional testing after the previous test failure to ensure a better user experience for you. Please download the temporary version for testing from the link below.

temp version:https://www.e-iceblue.com/downloads/TempVersion/Spire.Pdf_10.12.6-temp7233.zip

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Thu Jan 02, 2025 6:37 am

Hi Doris,

There are issues with some fonts still. As we will be using 'HP Universal PCL 6' print driver for most printing. Is it possible to fix the issues with this driver? Also, some documents appear blank page.

Is the latest spire.pdf included the bold character fix?

chenyongli
 
Posts: 10
Joined: Thu Nov 28, 2024 3:25 am

Thu Jan 02, 2025 9:08 am

Hello,


Thank you for your feedback.

Regarding the issue with incorrect background when printing the document "doc 3.pdf," I have logged this into our issue tracking system with the reference number SPIREPDF-7305. We will notify you once the issue has been resolved and a new version is available.

For the problem of blank pages occurring when printing the document "Doc 2 FET original.pdf," I was unable to reproduce the issue. Could you please provide your print code? Additionally, does this issue only occur when using the 'HP Universal PCL 6' printer, or are other printers also affected?

Thank you for your cooperation.


Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3047
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF

cron