PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

how to calculate the height of my header
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2751
Page 1 of 1

Author:  chhavi [ Fri Feb 28, 2014 9:54 am ]
Post subject:  how to calculate the height of my header

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);

Author:  Thomas Hoevel [ Tue Mar 04, 2014 9:50 am ]
Post subject:  Re: how to calculate the height of my header

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.

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