init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
47
Kreta.BusinessLogic/Helpers/AsposeHelper.cs
Normal file
47
Kreta.BusinessLogic/Helpers/AsposeHelper.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
using System.Data;
|
||||
using System.Drawing;
|
||||
using Aspose.Words;
|
||||
using Aspose.Words.Drawing;
|
||||
using Kreta.BusinessLogic.Classes.AsposeHelpers;
|
||||
|
||||
namespace Kreta.BusinessLogic.Helpers
|
||||
{
|
||||
public partial class AsposeHelper
|
||||
{
|
||||
private readonly DataSet _ds;
|
||||
private readonly AsposeHelperOptions options;
|
||||
private const string PAGE_BREAK_HTML = @"<div class=""pagebreak"">
|
||||
|
||||
</div>";
|
||||
|
||||
/// <summary>
|
||||
/// Csak hogy le lehessen kérni a metódusokat.
|
||||
/// </summary>
|
||||
public AsposeHelper()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public AsposeHelper(DataSet ds, AsposeHelperOptions options)
|
||||
{
|
||||
_ds = ds;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
private static void SetCustomHeaderOnDocument(Document resultDoc, Image fejlecImage)
|
||||
{
|
||||
if (fejlecImage == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var pageSetup = resultDoc.Sections[0].PageSetup;
|
||||
var header = resultDoc.Sections[0].HeadersFooters[HeaderFooterType.HeaderPrimary];
|
||||
var shape = new Shape(resultDoc, ShapeType.Image);
|
||||
shape.ImageData.SetImage(fejlecImage);
|
||||
shape.Width = pageSetup.PageWidth - pageSetup.LeftMargin - pageSetup.RightMargin;
|
||||
header.Paragraphs[0].RemoveAllChildren();
|
||||
header.Paragraphs[0].AppendChild(shape);
|
||||
pageSetup.TopMargin = (shape.Width / fejlecImage.Width * fejlecImage.Height) + pageSetup.HeaderDistance;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue