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 E832A17FE5 for ; Wed, 12 Nov 2014 05:51:05 +0000 (UTC) Received: (qmail 61381 invoked by uid 500); 12 Nov 2014 05:51:05 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 61358 invoked by uid 500); 12 Nov 2014 05:51:05 -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 61346 invoked by uid 99); 12 Nov 2014 05:51:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 05:51:05 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of imranakbarin@gmail.com designates 209.85.223.181 as permitted sender) Received: from [209.85.223.181] (HELO mail-ie0-f181.google.com) (209.85.223.181) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 05:50:39 +0000 Received: by mail-ie0-f181.google.com with SMTP id rp18so12874873iec.40 for ; Tue, 11 Nov 2014 21:49:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=kNU3IV6ciywxhloJmlYopl/36t6pCMn5FMzjmSGWk4g=; b=HEbDRP5OfUsALTbFRSS621k3xCuE+HgEoCn/7iPpMetKAmQ7ozzZxB79imeLpe2jPj G2l0Iou+Mt75gwbQ/tP6DB+FUqbPAWjMIPkO2QYvJFWKnQyvqQQgeDLURIBDH+Rw2jrF As49bskt9eJb6M8+pNWqxobFK2W26vPSDB/iZpbm8GhOV1cxyiQHyKiXpkqvi9iUEFwg 1Xwb08HHA5ltl4+f70m6u/WAaXv8HxFES3cvct1cRqYK30wpWLtRMjactcZY8FWhHBK7 Ir3fUTrlURPYrwbxgssaINnxCvzV4vKUmTvA3s0S9iLlZVzYCAVpLcPeCzimqFvYsabo Kjlg== MIME-Version: 1.0 X-Received: by 10.50.138.76 with SMTP id qo12mr37758421igb.43.1415771347926; Tue, 11 Nov 2014 21:49:07 -0800 (PST) Received: by 10.107.163.212 with HTTP; Tue, 11 Nov 2014 21:49:07 -0800 (PST) In-Reply-To: References: <6B3F23B8-D2FC-4275-87A3-54AF0B5EB5E9@jahewson.com> Date: Wed, 12 Nov 2014 08:49:07 +0300 Message-ID: Subject: Re: PDFBox Alignment for Existing PDF From: Imran Akbar To: users@pdfbox.apache.org Content-Type: multipart/alternative; boundary=001a1134b96446c6a40507a2f4e4 X-Virus-Checked: Checked by ClamAV on apache.org --001a1134b96446c6a40507a2f4e4 Content-Type: text/plain; charset=UTF-8 John, it would be great if you could provide an example implementing it. Thanks, Imran On Tue, Nov 11, 2014 at 9:15 PM, John Hewson wrote: > Sorry, I should have mentioned, we moved this functionality to the > PDFPrinter class in 2.0. > > -- John > > > On 11 Nov 2014, at 08:13, Imran Akbar wrote: > > > > Tilman, > > > > I tried viewing the pdf from commandline the pdf displayed correctly. > > > > John, > > > > I downloaded 2.0 from the link [ > > > http://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/2.0.0-SNAPSHOT/ > ] > > but i couldnt find the silentprint method available :( > > > > > > Thanks, > > Imran > > > > > > > > On Sun, Nov 9, 2014 at 8:11 PM, John Hewson wrote: > > > >> Printing in 1.8 has a number of bugs and limitations which have been > fixed > >> in the 2.0 trunk on SVN, so you might want to try that. > >> > >> -- John > >> > >>> On 9 Nov 2014, at 00:12, Imran Akbar wrote: > >>> > >>> Hi all, > >>> > >>> I am trying to load a pdf from URL/FIle and do a silent print by > choosing > >>> the default printer. it prints but the printed output is having issues > in > >>> the alignment, if documents contains Footers, they are getting stripped > >> off > >>> and not getting printed. is there a way to set the printing properties > >>> before we print the document when loading an existing document. Please > >> find > >>> my below code, > >>> > >>> ****** > >>> > >>> public class PrintPdf { > >>> > >>> public static PrintService choosePrinter() { > >>> PrinterJob printJob = PrinterJob.getPrinterJob(); > >>> if (printJob.printDialog()) { > >>> return printJob.getPrintService(); > >>> } else { > >>> return null; > >>> } > >>> } > >>> > >>> public static void printPDF(String fileName, PrintService printer) > >>> throws IOException, PrinterException { > >>> PrinterJob job = PrinterJob.getPrinterJob(); > >>> job.setPrintService(printer); > >>> > >>> PDDocument doc = PDDocument.load(fileName); > >>> > >>> doc.silentPrint(job); > >>> } > >>> > >>> public static void main(String[] args) throws IOException, > >>> PrinterException { > >>> > >>> printPDF("http://localhost/IS1330900025_3705.pdf", > >> choosePrinter()); > >>> } > >>> > >>> } > >>> > >>> **** > >>> > >>> - Imran > >> > > > > > > > > -- > > -- Imran Akbar > > -- -- Imran Akbar --001a1134b96446c6a40507a2f4e4--