PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 6:29 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Feb 28, 2014 9:54 am 
Offline

Joined: Fri Feb 28, 2014 9:23 am
Posts: 1
Hi

i am trying to get the image of each page of my input pdf document and drawing it on my output pdf documnent along
with header top of image.my header is dynamic ,the height of header will vary according to the content in it.
now the problam i am facing is that , i need to calculate the height and Y position of image based on the height of header
how can i do that?

i can not fix the area for header and image


//HEADER

Document doc = new Document();
Section sec = doc.AddSection();
// Add a single paragraph with some text and format information.
Paragraph para = sec.AddParagraph();
para.AddText(htmlHeader);


//IMAGE

XRect box = new XRect(10, 50, page.Width , (page.Height*80)/100);

// Final content peon one page

MigraDoc.Rendering.DocumentRenderer docRenderer = new DocumentRenderer(doc);
docRenderer.PrepareDocument();
docRenderer.RenderObject(gfx, 30, 0, "12cm", para);


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 04, 2014 9:50 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!

Just add paragraph and image to the same document and the image will automatically appear below the paragraph.

See also:
http://www.pdfsharp.net/wiki/Images-sample.ashx
PDFsharp source package includes the complete sample project.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 48 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