Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4F9DE200BB7 for ; Wed, 9 Nov 2016 13:26:50 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4E3DD160AFD; Wed, 9 Nov 2016 12:26:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 93E54160AEE for ; Wed, 9 Nov 2016 13:26:49 +0100 (CET) Received: (qmail 6964 invoked by uid 500); 9 Nov 2016 12:26:48 -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 6949 invoked by uid 99); 9 Nov 2016 12:26:48 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2016 12:26:48 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 94EECC31E3 for ; Wed, 9 Nov 2016 12:26:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.92 X-Spam-Level: ** X-Spam-Status: No, score=2.92 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, HTTP_ESCAPED_HOST=1.621, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 4HkxCUqXBpZe for ; Wed, 9 Nov 2016 12:26:43 +0000 (UTC) Received: from out.site1.exch580.serverdata.net (cas580-lo-8.exch580.serverdata.net [185.64.213.103]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 9FEF15F19B for ; Wed, 9 Nov 2016 12:26:43 +0000 (UTC) Received: from cliffordMacMini.local (195.99.170.50) by MBX580-U1-LO-1.exch580.serverpod.net (10.32.8.40) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 9 Nov 2016 04:26:17 -0800 Subject: Re: PDPattern PDFBOX-1094 To: References: <64d55286-d6b5-1a7f-e5c9-fc3dbf71aac3@t-online.de> <1fed79f4-de04-d3a6-a37f-d48672e4805e@paprika-software.com> From: clifford Organization: Agency Software Worldwide Ltd Message-ID: <967dc0e7-8e3e-1a52-1f28-4de95589fce6@paprika-software.com> Date: Wed, 9 Nov 2016 12:26:17 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------580123B3C787EBC9EBC1E6B3" X-Originating-IP: [195.99.170.50] X-ClientProxiedBy: CAS580-LO-8.exch580.serverpod.net (10.32.8.30) To MBX580-U1-LO-1.exch580.serverpod.net (10.32.8.40) archived-at: Wed, 09 Nov 2016 12:26:50 -0000 --------------580123B3C787EBC9EBC1E6B3 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Thanks for logging it :) I did try and do a quick and dirty, I downloaded the source and changed PDColorSpace... never used marvin before, and it didn't want too play ball, in the end found one of the poms was incorrect, fixed that and compiled it all up. changed return new PDPattern(resources); with PDPattern p = new PDPattern(resources); p.array = new COSArray(); p.array.add(COSName.PATTERN); return p; Got that object right and it added to getResources() quit nicely. but when calling PDPageContentStream.setNonStrokingColor(PDColor) with PDColor using the pattern resource using PDPage.getResources().getColorSpace(COSName.getPDFName("R9")) when using PDColor(float[] components, COSName patternName, PDColorSpace colorSpace) so :- COSArray ca = new COSArray(); ca.add(COSName.PATTERN); PDPage.getResources().put(COSName.getPDFName("R9"),PDColorSpace.create(ca,PDPage.getResources())); PDColor pdColour = new PDColor(new float[]{colour.getRed()/255f,colour.getGreen()/255f,colour.getBlue()/255f},COSName.getPDFName("Patten1"),PDPage.getResources().getColorSpace(COSName.getPDFName("R9"))); PDPageContentStream.setNonStrokingColor(pdColour); when calling setNonStrokingColor it duplicates the PDPattern and so the PDPage.getResources() ends up with another item in the colour space, with a completely different name, and by the way the PDF comes out, it dose not like this also PDFDebugger when selecting Page: 1 gets a null pointer so its not too happy with the result. So I think I will wait for the proper fix, as I do not understand, the underline engine. On 08/11/2016 19:41, Tilman Hausherr wrote: > Am 08.11.2016 um 18:58 schrieb clifford: >> I have figured it out there is a bug in PDColorSpace. >> >> At no point you can not get a PDPattern with the variable array set. >> >> so the method in PDSpecialColorSpace "public COSBase getCOSObject()" >> always returns null, which is why it fails to get put into the resource. > > You're right. I need to think about this. I have opened an issue > https://issues.apache.org/jira/browse/PDFBOX-3560 > > Tilman > >> >> >> >> On 08/11/2016 17:00, Tilman Hausherr wrote: >>> Am 08.11.2016 um 16:00 schrieb clifford: >>>> in PDFBOX-1094 >>>> there is a file called gs-bugzilla691715.pdf >>>> >>>> Was this file generated by PDFBox, if so could I have the source as >>>> I am trying to get PDPattern to work. >>> >>> No, the file is from ghostscript: >>> http://bugs.ghostscript.com/show_bug.cgi?id=691715 >>> >>> I've never heard that people create PDFs with patterns because it's >>> complex. But you're welcome and hopefully you'll be helped. Last >>> year we had a guy who created shadings from scratch. >>> >>>> >>>> when doing >>>> cvPage.getResources().put(COSName.getPDFName("R9"),PDColorSpace.create(COSName.PATTERN,cvPage.getResources())); >>>> >>>> >>>> cvPage = a PDPage object >>>> >>>> The Pattern is not added to the resources items, there is code in >>>> PDFBox that actually stops a PDPattern from being added? >>>> I can add any other PDColorSpace object I like but not a >>>> COSName.PATTERN one. >>> >>> Can you create some small but complete code that "proves" that the >>> Pattern is not being added? Obviously you have something, but I, to >>> help you, would have to create something from scratch. >>> >>> >>> Tilman >>> >>>> >>>> looking at gs-bugzilla691715.pdf it looks like ColourSpace Patten >>>> has been added to Resources as a array under ColorSpace, how did >>>> they do that. >>>> >>> >>> >>> --------------------------------------------------------------------- >>> 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 > -- *Kind regards* *Clifford Dann Paprika* T +44 (0)1732 811601 www.paprika-software.com Latters House, High Street, Hadlow, Tonbridge, Kent, TN11 0EF, United Kingdom Agency Software Worldwide Ltd. Registered in England and Wales 01665695 --------------580123B3C787EBC9EBC1E6B3--