PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

replace placeholders in PDF file
http://forum.pdfsharp.com/viewtopic.php?f=2&t=505
Page 1 of 1

Author:  gastan [ Sat Oct 18, 2008 4:22 pm ]
Post subject:  replace placeholders in PDF file

Hi

I used PDFSharp to place objects (self made charts) into existing PDF document (tempalte with loads of text), but it's not really practical to position it in pixels. Is there any way to place some placeholders (bookmars in word) into PDF document and replace them in their position with my object ?
I assume teplates and position of inserted objects will change with upcoming versions, so I dont wanna change those positions with each new template. also, is there any wayto figure cordinates in document ?

best reards

--G

Author:  franslundberg [ Wed Oct 21, 2009 3:26 pm ]
Post subject:  Re: replace placeholders in PDF file

I would love to see an answer to this post.

Author:  Markus R. [ Thu Oct 06, 2022 9:53 am ]
Post subject:  Re: replace placeholders in PDF file

i have a similar problem, i will add a image above a given word which exists in a pdf.
so i need the x,y position from word.
i use "PDFsharp" in a ms vs 2022 c# project.

Author:  TH-Soft [ Mon Oct 10, 2022 8:59 am ]
Post subject:  Re: replace placeholders in PDF file

Markus R. wrote:
so i need the x,y position from word.
PDFsharp does not have an API for text extraction and it does not have an API to get co-ordinates.
You can start with the text extraction code for PDFsharp that was posted on the web and add code that gets the text position.
Depending on the PDF files you have to deal with, this can be rather simple or really complicated.

Author:  Markus R. [ Mon Oct 10, 2022 1:05 pm ]
Post subject:  Re: replace placeholders in PDF file

TH-Soft wrote:
Markus R. wrote:
so i need the x,y position from word.
PDFsharp does not have an API for text extraction and it does not have an API to get co-ordinates.
You can start with the text extraction code for PDFsharp that was posted on the web and add code that gets the text position.
Depending on the PDF files you have to deal with, this can be rather simple or really complicated.


ok, thank you.
edit:
my solution was FreeSpire pdf, there i can get text with positions.

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