Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 52154176F4 for ; Tue, 28 Apr 2015 16:09:42 +0000 (UTC) Received: (qmail 70898 invoked by uid 500); 28 Apr 2015 16:09:42 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 70878 invoked by uid 500); 28 Apr 2015 16:09:42 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 70860 invoked by uid 99); 28 Apr 2015 16:09:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2015 16:09:41 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: message received from 54.164.171.186 which is an MX secondary for users@pdfbox.apache.org) Received: from [54.164.171.186] (HELO mx1-us-east.apache.org) (54.164.171.186) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2015 16:09:34 +0000 Received: from mailout08.t-online.de (mailout08.t-online.de [194.25.134.20]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id D716A43DC3 for ; Tue, 28 Apr 2015 16:09:13 +0000 (UTC) Received: from fwd13.aul.t-online.de (fwd13.aul.t-online.de [172.20.27.62]) by mailout08.t-online.de (Postfix) with SMTP id 6DF605842F3 for ; Tue, 28 Apr 2015 18:09:07 +0200 (CEST) Received: from [192.168.2.102] (ZG0ayyZYghrBHK+XRAmh6uAUJNFv81hXMFhHTuo3hLWX6spPap1DwfpnJftBfWEg+N@[217.231.130.200]) by fwd13.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1Yn84I-4LO9aK0; Tue, 28 Apr 2015 18:09:06 +0200 Message-ID: <553FB0E3.9030804@t-online.de> Date: Tue, 28 Apr 2015 18:10:11 +0200 From: Tilman Hausherr User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: users@pdfbox.apache.org Subject: Re: Picture not printed References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------080405000404050003060405" X-ID: ZG0ayyZYghrBHK+XRAmh6uAUJNFv81hXMFhHTuo3hLWX6spPap1DwfpnJftBfWEg+N X-TOI-MSGID: b015cabb-2558-46e8-8022-f05d8709e02b X-Virus-Checked: Checked by ClamAV on apache.org --------------080405000404050003060405 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, PDF files are not attached in the mailing list. Can you upload it to a public place? Tilman Am 28.04.2015 um 10:48 schrieb Gregor Kovač: > Hi! > > I've been using PDFBox 1.8.9 for printing PDF files. In the attachment > (eSlog_380_1031000000002_012354698725.pdf) is a PDF file with one > picture in upper left corner, that does not get printed out at all > (attachment "Java Printing.pdf"). There is a blank space instead of > picture. > > Why? > > This is the code I use for printing: > private static void printWithPDFBox(File pdfFile, int copies) { > boolean silentPrint = true; > String printerName = null; > String password = null; > PDDocument document = null; > try { > document = PDDocument.load(pdfFile); > > if (document.isEncrypted()) { > document.decrypt(password); > } > > PrinterJob printJob = PrinterJob.getPrinterJob(); > printJob.setJobName(pdfFile.getName()); > > if (printerName != null) { > PrintService[] printService = > PrinterJob.lookupPrintServices(); > boolean printerFound = false; > for (int i = 0; !printerFound && i < > printService.length; i++) { > if (printService[i].getName().indexOf(printerName) > != -1) { > printJob.setPrintService(printService[i]); > printerFound = true; > } > } > } > > printJob.setPageable(new PDPageable(document, printJob)); > printJob.setCopies(copies); > if (silentPrint || printJob.printDialog()) { > printJob.print(); > } > } catch (Exception e) { > e.printStackTrace(); > } finally { > if (document != null) { > try { > document.close(); > } catch (IOException e) { > e.printStackTrace(); > } > } > } > } > > Best regards, > Kovi > > -- > -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ > | In A World Without Fences Who Needs Gates? | > | Experience Linux. | > -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > For additional commands, e-mail: users-help@pdfbox.apache.org --------------080405000404050003060405--