Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Method GetPageColorSpaces() not working? |
Post Reply |
Author | |
martin.weigl
Team Player Joined: 23 Feb 16 Location: Upper Austria Status: Offline Points: 27 |
Post Options
Thanks(0)
Posted: 25 Apr 16 at 1:13PM |
Hi Ingo,
thx for your help! Regards, Martin
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Yes... but coloured elements (rgb or cmyk) can be inside without a tag :(
That's pdf ... or that what somebody doing with it ;-) |
|
Cheers,
Ingo |
|
martin.weigl
Team Player Joined: 23 Feb 16 Location: Upper Austria Status: Offline Points: 27 |
Post Options
Thanks(0)
|
Hi Ingo,
thx. Now I have an idea, why GetPageColorSpaces() doesn't return anything: no device tags in the PDFs. Thx, martin
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Martin,
GetPageColorSpaces will collect the device-tags if there are any. It's not a must to have devicetags for coloured pages. You can have cmyk-colours without a /DeviceCMY inside and you can have rgb-colours without a /DeviceRGB. Better: You can have a b/w-page with a /DeviceRGB inside. Here a piece of code with notepad out of a pdf of mine: << /Filter /FlateDecode /Height 28 /Length 206 /BitsPerComponent 1 /Width 688 /ColorSpace [ /Indexed /DeviceRGB 1 (‡¦›Ù ·) ] /Subtype /Image /Type /XObject You can see /BitsPerComponent 1 ... and this mean b/w-page You can see /DeviceRGB ... but it's from a b/w-page. Searching for a sample for you i've to check many pdfs 'cause often the device-tags were missing. |
|
Cheers,
Ingo |
|
martin.weigl
Team Player Joined: 23 Feb 16 Location: Upper Austria Status: Offline Points: 27 |
Post Options
Thanks(0)
|
Hello all,
on my search for a way to check, if RGB images are contained in an existing PDF file i found the method GetPageColorSpaces(). Supposing that this was exactly what I was looking for, i tried to iterate through the pages of the PDF file and call the method. No idea why, but it always returned an empty string. Did I get the main purpose of this method wrong or do I need anything else to retrieve color space information (additional libraries, etc.)? Regards, Martin My code looks something like this: bool rgbFound = false; for (int page = 1; page <= this.Library.PageCount(); page++) { this.Library.SelectPage(page); string colorSpaces = this.Library.GetPageColorSpaces(0); // colorSpaces is always "" if (colorSpaces.ToLower().Contains("rgb")) { rgbFound = true; break; } }
if (rgbFound) { ... |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store