Hello,
I am converting a dwg file to a pdf. Then I need to insert a heading (“CAD Drawing”) at the very top of the page. As you can see in this image: image.png (46.5 KB)
the text is over the image. My question is how to push the drawing down and so to have space for the heading. Here is the code I am using:
using (Aspose.CAD.Image cadImage = Aspose.CAD.Image.Load(cadFile))
{
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions
{
PageWidth = cadImage.Width * 3 + 20,
PageHeight = cadImage.Height * 3,
DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseObjectColor,
GraphicsOptions = new GraphicsOptions
{
TextRenderingHint = TextRenderingHint.SingleBitPerPixel,
},
Zoom = 1f,
};
var opt = new PdfOptions { VectorRasterizationOptions = rasterizationOptions};
cadImage.Save(tempPath, opt);
}
Aspose.Pdf.Document doc6 = new Aspose.Pdf.Document(tempPath);
var pg = doc6.Pages[1];
Heading title = new Heading(1);
title.Text = “CAD Drawing”;
title.HorizontalAlignment = HorizontalAlignment.Center;
title.TextState.FontSize = 30;
pg.Paragraphs.Insert(0, title);
doc6.Save(outputPath);