PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Apr 23, 2024 2:42 pm

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
 Post subject: Double border - how to?
PostPosted: Wed Jul 27, 2016 2:08 pm 
Offline

Joined: Tue Jul 26, 2016 5:07 pm
Posts: 32
Good morning!

Let me start, like many other first-time posters, with high praises for this wonderful package!
I started using MigraDoc to create the PDF files from C# code and it was a breeze to go through the samples and get production-quality PDFs almost in an instant. Big Thank You!

The question I have is about paragraph borders.

Our client provided us with a template which has a double border around one paragraph: the top line is about 3pt and bottom line is 1pt.
They said that we only need to do our best to try and follow, but I though why not reproduce this one too:

Image

How can I create such double border in MigraDoc without using an image?


Last edited by vorobej on Wed Jul 27, 2016 7:31 pm, edited 3 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 27, 2016 5:27 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 916
Location: CCAA
Hi!
vorobej wrote:
the top line is about 3pt and bottom line is 1pt.
Do you mean "outer" and "inner" (i.e. double border on all four sides)?
Or do you mean two horizontal lines ("top" and "bottom")?

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 27, 2016 6:35 pm 
Offline

Joined: Tue Jul 26, 2016 5:07 pm
Posts: 32
This:
Image

A link to the image just in case as it seems to intermittently show or not: http://picpaste.com/pics/Capture-YyYduz ... 645613.JPG


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 27, 2016 8:09 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 916
Location: CCAA
What I would try:
Add an empty paragraph and set the thick line as its top border.
Add another paragraph (either empty or with the page number) and set the thin line as its top border.

You can set an absolute height for the first paragraph - this will allow you to fine-tune the gap between the lines.

Or this:
Add an empty paragraph and set the thick line as its top border and the thin line as the bottom border.
You can set an absolute height for this paragraph - this will allow you to fine-tune the gap between the lines.
Put the page number into another paragraph.

A table can also be used. I'd try that if the idea with the paragraphs should fail.

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 27, 2016 8:24 pm 
Offline

Joined: Tue Jul 26, 2016 5:07 pm
Posts: 32
Brilliant idea about 2 paragraphs. That's probably the most light-weight approach.


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: Google [Bot] and 196 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:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group