You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Hugo Resendez <hu...@flex.com> on 2017/06/01 20:03:42 UTC

RE: Problem with a font free3of9_3.ttf


Hello friends of pdfbox, I used the pdfbox tool to print pdf documents, but when I send the document the corresponding font free3of9_3 I print it in pure boxes, the fonts are correctly installed on my PC. This is the piece of code with which I make the impression. Attached image files.


File fileDirectory = new File("C:\\pdf");
            File tempFile = File.createTempFile("Document", ".pdf",fileDirectory);
            try (FileOutputStream fos = new FileOutputStream(tempFile))
            {
                fos.write((byte[])map.get("LicenseDocumentPDF"));
                fos.flush();
                fos.close();
            }
            PrintService printService =  findPrintService(GetPrinterName("HP").Data().toString());
            PrinterJob pJob = PrinterJob.getPrinterJob();
            pJob.setPrintService(printService);
            PDDocument document =  PDDocument.load(tempFile);
            pJob.setPageable(document);
            pJob.print();
            //document.silentPrint(pJob);
            document.close();

Legal Disclaimer:
The information contained in this message may be privileged and confidential. It is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message!

Re: Problem with a font free3of9_3.ttf

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 01.06.2017 um 22:03 schrieb Hugo Resendez:
>
> Hello friends of pdfbox, I used the pdfbox tool to print pdf documents, but when I send the document the corresponding font free3of9_3 I print it in pure boxes, the fonts are correctly installed on my PC. This is the piece of code with which I make the impression. Attached image files.

Could you please upload the files to a sharehoster? These don't get through.

I haven't understood your text. Your code does not do anything with the 
free3of9_3.ttf font, and I don't understand what the first half of the 
code is for. And what do you mean with "I print it in pure boxes"?

Tilman

>
>
> File fileDirectory = new File("C:\\pdf");
>              File tempFile = File.createTempFile("Document", ".pdf",fileDirectory);
>              try (FileOutputStream fos = new FileOutputStream(tempFile))
>              {
>                  fos.write((byte[])map.get("LicenseDocumentPDF"));
>                  fos.flush();
>                  fos.close();
>              }
>              PrintService printService =  findPrintService(GetPrinterName("HP").Data().toString());
>              PrinterJob pJob = PrinterJob.getPrinterJob();
>              pJob.setPrintService(printService);
>              PDDocument document =  PDDocument.load(tempFile);
>              pJob.setPageable(document);
>              pJob.print();
>              //document.silentPrint(pJob);
>              document.close();
>
> Legal Disclaimer:
> The information contained in this message may be privileged and confidential. It is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message!



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org