PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon May 28, 2018 3:25 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Apr 29, 2018 10:09 am 
Offline

Joined: Thu Nov 11, 2010 10:03 am
Posts: 7
Hello
Since I use PdfSharp with cSharp, I usually create document from scratch, positioning text and image with relative of absolute xRect
Straight and easy

But in some case it can be more relevant to Open a previously created PDF Template and just fill in a few variable elements (Name, Adress etc)

Is it possible to create such Template with PdfSharp ?
I guess it should be a way to specify variable fields ans save a PDF as a template
Then import the template with a PdfReader and fill the fields

Unfortunately I was not able to find clear and effective explanation about this ?
Is it possible ?
Is it the way it would works ?

Thanks for any help


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 29, 2018 12:04 pm 
Offline
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 376
Location: CCAA
Hi!
olibara wrote:
Unfortunately I was not able to find clear and effective explanation about this?
There are many ways.
One approach:
http://pdfsharp.net/wiki/XForms-sample.ashx

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 29, 2018 7:40 pm 
Offline

Joined: Thu Nov 11, 2010 10:03 am
Posts: 7
Thank you TH-Soft

I had seen this example but as it is mentioned it "Draw the XPdfForm on your PDF page like an image:"

This is far from an efficient way to use a Template
Also this is not really a template at all : this is only a graphic component ready to be drawn as an image !

What I was more looking for, it is a way to anchor a few variable in a PDF document (name, address, Date etc..) and save-it as a template
Then Import that template replace the variable by the current value and save the result as final document !

Is it first possible ? .. and is there some easy way to do it ?

If not, I can of course continue to create the whole final document from scratch but this is less flexible and requires an update of the application for any lay-out changes


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 30, 2018 6:33 am 
Offline
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 376
Location: CCAA
olibara wrote:
This is far from an efficient way to use a Template
There is little overhead in the PDF file, so with respect to that this method is efficient.

olibara wrote:
If not, I can of course continue to create the whole final document from scratch but this is less flexible and requires an update of the application for any lay-out changes
We use a generic application and customer-specific DLLs that handle the layout. Those DLLs include PDF files with pre-made pages for cover and some content pages, but also page backgrounds.
We do not have to change the application if the layout changes for one customer. But we still have to compile a DLL for them.

If you think that AcroForms are templates as you want them, then feel free to try them. Older versions of PDFsharp included an AcroForms sample.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 30, 2018 6:34 pm 
Offline

Joined: Thu Nov 11, 2010 10:03 am
Posts: 7
Thank you TH-Soft
Indeed DLL can be an alternative

The best would be anyway what I think Acroform is : Having a PDF document template with Anchored variables, Open and fill fariables with Values ...
But Have no Idea how to really use it ?

- Is my understanding correct ?
- Is it still supported ?
- Do you have some link where I can found explanation about a:Create a template with variable fields, b:Fill the template with values

Thanks a lot for your Help


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group