PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Reading PDF, extracting colours, adjusting them and writing
https://forum.pdfsharp.net/viewtopic.php?f=2&t=4090
Page 1 of 1

Author:  peter_mcc [ Thu Feb 06, 2020 1:18 am ]
Post subject:  Reading PDF, extracting colours, adjusting them and writing

Hi

I print orienteering maps for various clubs - they usually arrive as a PDF. The maps should have about 20 colours in them using standard CMYK values however sometimes people use the wrong values so when I print them they look funny.

I've taken a bit of a look at the docs but can't work out - is it possible to read in a PDF file, iterate through every object to build up a colour table then adjust the colours of each object and write the PDF back out?

I've done a fair bit of C# in the past though normally I work in embedded C so I am a bit rusty. If it is possible is it something that would take hours to write a simple version? days? weeks?

thanks
Peter

Author:  TH-Soft [ Thu Feb 06, 2020 7:23 am ]
Post subject:  Re: Reading PDF, extracting colours, adjusting them and writ

Hi, Peter!
peter_mcc wrote:
If it is possible is it something that would take hours to write a simple version? days? weeks?
I think it'll take days.
Maybe it'll take hours to get it working for the first file.
But when the second file comes from a different source (different PDF generator) you may find that it takes hours to update the code to make it work with both files.

PDFsharp does not dive into page elements, so writing that part is left to you. Google will find code snippets that deal with text traction and those may serve as a starter.

Author:  peter_mcc [ Thu Feb 06, 2020 11:15 pm ]
Post subject:  Re: Reading PDF, extracting colours, adjusting them and writ

Thanks. There should be a limited number of programs which generate the files but I might look at other options for the moment, especially if PdfSharp doesn't deal with the page elements.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/