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!
Get Colors in PDF |
Post Reply |
Author | |
Cefeg
Beginner Joined: 16 Feb 16 Location: California Status: Offline Points: 10 |
Post Options
Thanks(0)
Posted: 27 Dec 18 at 5:14AM |
Does anyone have sample code or methodology to get the number of colors in a PDF? I am using C# with QuickPDF DLL v16.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(1)
|
Hi Cefeg,
you can analyze with QuickPDF how the color settings are set (the device tags with b/w, cmyk or rgb) or with GetPageColorSpaces: https://www.debenu.com/docs/pdf_library_reference/GetPageColorSpaces.php But you won't be able using QuickPDF to determine the real used colors in a pdf (the naked pages and embedded images). If you want this you should convert the pdf into an image and then trying the "bitmap" to get the color pixel by pixel. |
|
Cheers,
Ingo |
|
Cefeg
Beginner Joined: 16 Feb 16 Location: California Status: Offline Points: 10 |
Post Options
Thanks(0)
|
Thanks so much, Ingo. I will give the two methods a try. I need only to determine if the document is b&w or color. Ideally also to determine if a b&w document is bitonal or grayscale.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi,
instead these tags regarding color types isn't a save methode to determine what's inside: Internally the pdf-structure offers the device-flags like - for example - DeviceRGB, DeviceGray oder DeviceCMYK which points to the used colours in the document. Better: It could point 'cause it's not a must to use device-flags in the pdf- document. It's possible to have coloured pages in a document with DeviceGray and it's possible to have coloured and b/w-pages in a document without any device-flag and it's possible to have only b/w-pages in a document with DeviceCMYK and so on... So the device-flags are only indicators for the used colour- models in a document but not a save method to determine coloured pages. |
|
Cheers,
Ingo |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(1)
|
perhaps you can do something similar.
Here's something from my blog... http://pdfcomments.blogspot.com/2012/12/analyze-pdf-documents-for-coloured-pages.html |
|
Cheers,
Ingo |
|
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