Return-Path: X-Original-To: apmail-pdfbox-dev-archive@www.apache.org Delivered-To: apmail-pdfbox-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E22EE18118 for ; Fri, 4 Dec 2015 18:53:14 +0000 (UTC) Received: (qmail 24707 invoked by uid 500); 4 Dec 2015 18:53:11 -0000 Delivered-To: apmail-pdfbox-dev-archive@pdfbox.apache.org Received: (qmail 24676 invoked by uid 500); 4 Dec 2015 18:53:11 -0000 Mailing-List: contact dev-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list dev@pdfbox.apache.org Received: (qmail 24479 invoked by uid 99); 4 Dec 2015 18:53:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Dec 2015 18:53:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 54E792C1F87 for ; Fri, 4 Dec 2015 18:53:11 +0000 (UTC) Date: Fri, 4 Dec 2015 18:53:11 +0000 (UTC) From: "Tilman Hausherr (JIRA)" To: dev@pdfbox.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PDFBOX-3133) PDFBox 2.0.0-RC2 and earlier 2.0.0 SNAPSHOT Versions print performance is poor with systems having low RAM < 3GB and lower number of fonts. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PDFBOX-3133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041979#comment-15041979 ] Tilman Hausherr commented on PDFBOX-3133: ----------------------------------------- Q1: there is no such thing as multipage PNG. TIFF has multipage, but the compression for non-black+white images is not very good. So you'll have to either make several requests to the server, or pack the files into a single one. Doing two requests brings an advantage: you could ask for page 1 and page 2 at the same time, i.e. render both pages similarly. (But the server must use different PDDocument objects). (I assume the computer prints two receipts, one for that the customer signs and one that he/she keeps) Q2: re size: that is tricky... you either find a resolution that brings an image is exactly the size that will be printed, or you render to a higher resolution and use a drawImage() method that does scaling, e.g. {{boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)}}. I don't know the dpi of your printer, nor the exact size of the paper. Q3: sorry, don't know. Btw code can be included within "{{code}}...{{code}}", this looks nicer in JIRA. > PDFBox 2.0.0-RC2 and earlier 2.0.0 SNAPSHOT Versions print performance is poor with systems having low RAM < 3GB and lower number of fonts. > ------------------------------------------------------------------------------------------------------------------------------------------- > > Key: PDFBOX-3133 > URL: https://issues.apache.org/jira/browse/PDFBOX-3133 > Project: PDFBox > Issue Type: Improvement > Components: PDModel > Affects Versions: 2.0.0 > Environment: MS Windows Systems with low RAM < 3GB and number of fonts were less < 592 (or if desired fonts in PDF to be printed are not available in local system ) > Reporter: Sridhar > Assignee: John Hewson > Labels: performance > Fix For: 2.0.0 > > > PDFBox 2.0.0-RC1, SNAPSHOTS and RC2 versions print takes 15+ seconds. > Steps to reproduce > -------------------------- > Use Windows System with < 3 GB RAM > Use Systems with less number of fonts or without specific fonts in PDF file to be printed. > Printing PDF file > Took 14 to 20 seconds in system with 3 GB RAM which had 522 foints > Took 24 to 34 seconds in system with 2 GB RAM which had 90 fonts > Took only 2.5 seconds in system with 8 GB RAM which had 1025 fonts. > Doubt > -------- > Not browsed the code, but following is the doubt as causing performance issue. > Though the code caches fonts by storing fonts in local .pdfbox.cache file first time and caching fonts for subsequent times. > Not clear whether the code updates the pdfbox fonts cache file if new fonts are found in new PDF file to be printed, while printing subsequent times. > If the fonts in PDF file to be printed is not available in the .pdfbox.cache file stored in local system/local system what is the behaviour? Will the code download fonts and update cache for subsequent times or is it limited by fonts available in local system? Looks like later is the case and performance got hit either due to RAM or not constantly updating fonts cache or due to un availability of fonts in local system. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org For additional commands, e-mail: dev-help@pdfbox.apache.org