I want to copy some text or area with (x,y) from existing pdf and paste it to a new pdf.
i am using pdfsharp.how to do this?
can anybody help?
If you want to extract text, look at these threads:
C# PDFSharp: Examples of how to strip text from PDF?
C# Extract text from PDF using PdfSharp
If you want to extract an image of the page (or a part of it), look at this thread:
Export PDF to JPG(s) in C#
Related
I want to convert the complex word document (which includes both text and images) into RTF text preserving formatting information. Sample image of document content is as shown below
How I can read this information as RTF text so that I can perfectly preserve the formatting and image location information. I tried to read word file using RichTextbox's LoadFile function but it doesn't preserve the formatting & image location information.
Looking forward to receive some suggestions to maintain the formatting and image location information.
Thanks
You could simply save the document in the RTF format...
I have a richtextbox and by far, i have been successful in converting plain text into pdf using iTextsharp. Now, the situation is, when i copy some text from any source let's say a website and along text, it contains images. Now when i try to convert the content (text + images) into pdf, resulting pdf doesn't show images. I know that there would be some property to be set for the richtextbox or using itextsharp so to have images as well. I also know that we can insert images by giving path to that image but this is not what i want. I want to have plain text along with images while direct conversion from richtextbox to pdf. Forexample i have,![Im resulting pdf i want the same as in richtextbox][1]: http://i.stack.imgur.com/ts0ec.jpg
How can i have the same as in richtextbox? How can i specify orientation for text and image to be justified?
I am a total noob to working with PDF documents in C#. Can someone please give me an example of how can I change the background and text colors of an existing document using C#(I tried it via iTextSharp but failed to understand how it can change the color properties of a document).
Will really appreciate the help guys. Thanks
To highlight the text refer:
Highlighting text ( colors ) of existing PDF using iTextsharp using C#
And text color and fonts refer this:
http://www.mikesdotnetting.com/Article/81/iTextSharp-Working-with-Fonts
I have some RTF text. Sometimes text contain some images. Images is displayed inside any rtf editor, but i cannot get images positions programmatically.
I have used RichTextBox control for RTF parsing, but is unable to detect image positions inside text in RichTextBox control
So, does anybody know how to parse RTF and get images positions inside text programmatically using C#?
You might take a look at http://www.codeproject.com/KB/string/nrtftree.aspx it is open source and able to extract images, so I hope this helps.
I'm trying to replace a section of a PDF with different text. From research on all major PDF libraries for .NET, it seems this is complicated and not a trivial task. I think it may be easier to convert the PDF to an image, replace the text (always in the same place), then convert it back to a PDF (or leave it as an image if converting back isn't possible). Is it possible to extract an image from a PDF page with .NET?
If your text is in a known location, you can simply cover it with a rectangle filled with the background color, and then draw your text over top.
Note that the text will still be there, it simply won't be visible. Someone selecting text will still pick up the old stuff. If that's acceptable, it's quite trivial.
If the PDF was created from image, you can import it into Photoshop to edit it as an graphic. Or you can use screenshot program like "Snagit" to capture pdf page as image and use snagit's editor to erase old text and replace new one.
But this method may bring you problem is that the new added text may not the same font as text around it. Personally, I use pdf editor to replace text in pdf since the added text will be automatically fit with the original font and size.