Edit PDF Text
Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1378
Printed Date: 23 Nov 24 at 7:18AM Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com
Topic: Edit PDF Text
Posted By: nzcivic
Subject: Edit PDF Text
Date Posted: 22 Mar 10 at 1:30AM
Hi,
I want to be able to find and edit text on a page...
I understand I can use the GetPageText to find the text I'm after, Now that I have the location etc... i need to edit the text.
What is the best way...
Can the text be edited directly?
Can I recreate a new PDF with all the existing content except the "text" and then draw my new text? If so how?
Thanks,
|
Replies:
Posted By: Ingo
Date Posted: 22 Mar 10 at 7:18AM
Hi!
You can't edit the textcontent directly. You can extract the text and many pdf-properties, edit the extracted text and try to build a similar pdf-document. "If so... how": Here, in the general section you can find a thread "The first steps...". There you can read all you need.
Cheers and welcome here, Ingo
|
Posted By: nzcivic
Date Posted: 22 Mar 10 at 11:50AM
Hi,
I have noticed that the GetPageText function returns the color in RGB even though my text in the PDF is saved as CMYK
What is the best way to convert the RGB to CMYK?
I use the following function below... but what I would like to know is the function used by Quick PDF to convert CMYK to RGB? that way it can be reversed to preserve color
public class Cmyk { public double C { get; set; } public double M { get; set; } public double Y { get; set; } public double K { get; set; }
public Cmyk(double r, double g, double b) { double R = 1.0 - r; double G = 1.0 - g; double B = 1.0 - b;
if (R < G) { K = R; } else { K = G; } if (B < K) { K = B; }
C = CalcCmyk(r, K); M = CalcCmyk(g, K); Y = CalcCmyk(b, K); }
private static double CalcCmyk(double rgb, double k) { if (((1 - rgb - k) <= 0) || ((1 - k) <= 0)) { return 0; } return (1 - rgb - k) / (1 - k); } }
Will this preserve the color 100%
Thanks,
|
|