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 6369618164 for ; Thu, 10 Mar 2016 17:10:45 +0000 (UTC) Received: (qmail 51879 invoked by uid 500); 10 Mar 2016 17:10:45 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 51857 invoked by uid 500); 10 Mar 2016 17:10:45 -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 51846 invoked by uid 99); 10 Mar 2016 17:10:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Mar 2016 17:10:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id F19501A0CE1 for ; Thu, 10 Mar 2016 17:10:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.67 X-Spam-Level: X-Spam-Status: No, score=0.67 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RP_MATCHES_RCVD=-0.329] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id qBPFjAs-gFBh for ; Thu, 10 Mar 2016 17:10:42 +0000 (UTC) Received: from mailout06.t-online.de (mailout06.t-online.de [194.25.134.19]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id E1C345FAC2 for ; Thu, 10 Mar 2016 17:10:42 +0000 (UTC) Received: from fwd30.aul.t-online.de (fwd30.aul.t-online.de [172.20.26.135]) by mailout06.t-online.de (Postfix) with SMTP id 898B07E67F for ; Thu, 10 Mar 2016 18:10:36 +0100 (CET) Received: from [192.168.2.104] (V8hNM-ZfrhYqNKunJFV0OkOT8Pb0LXAWwioQwKCnEryaCdnYimIrDfx6qzGFMJXwmZ@[217.231.137.199]) by fwd30.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1ae46d-0PjAi80; Thu, 10 Mar 2016 18:10:35 +0100 Subject: Re: How to reset text on a new page? To: users@pdfbox.apache.org References: <56DFC28B.8000607@t-online.de> From: Tilman Hausherr Message-ID: <56E1AA98.3090005@t-online.de> Date: Thu, 10 Mar 2016 18:10:48 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-ID: V8hNM-ZfrhYqNKunJFV0OkOT8Pb0LXAWwioQwKCnEryaCdnYimIrDfx6qzGFMJXwmZ X-TOI-MSGID: cabbd84b-8072-411a-8886-decc99056b11 Am 10.03.2016 um 15:50 schrieb Blake McBride: > Thanks, but getting a little confused here. Let me ask this: > > Each page in a document has its own PDPageContentStream _and_ PDPage. This > means that there is a one-to-one relationship between PDPageContentStream's > and PDPage objects. Is that (always) true? No. It is possible to have the same content stream for several pages. It is even possible to have the same page object several times. This is possible, but would not be very useful, obviously. And that may be what happened to you. And it is also possible to have an array of content streams for one page, but that is a different story. If still you don't know what went wrong, please post your code (rather, the shortest possible code that reproduces the problem). Tilman > > Thanks. > > Blake > > > > On Wed, Mar 9, 2016 at 12:28 AM, Tilman Hausherr > wrote: > >> You must create a new content stream object for each page. And of course >> also a new PDPage object too. >> >> Tilman >> >> >> Am 09.03.2016 um 04:31 schrieb Blake McBride: >> >>> Hi, >>> >>> I get that one starts text with contentStream.beginText() and ends text >>> with contentStream.endText(). And I get that one gets a new page with doc >>> .addPage(page). But when I use all this to print two pages, I end up with >>> two pages each with the same text (the merge of the contents of the two >>> pages). How can I clear the page contents for a new page? (I didn't see >>> an example that printed two pages in the examples.) >>> >>> Thanks! >>> >>> Blake McBride >>> >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org >> For additional commands, e-mail: users-help@pdfbox.apache.org >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org