And my post seem to be very simple, but i need your help.
i just use this program because of my lab subject.
i have to change html file to pdf file exactly same size.(there are some chart and picture and unit is millimeter)
i tried program and made test pdf file but they they were cut some part.
i think it's because page size is A4. how can i change page size? and how rotate page?(width is bigger than height )
And how can i save picture and chart exactly same size by millimeter
there is c# code i used.
- Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Spire.Pdf;
using System.Threading;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
String fromUrl = "C:/Users/Administrator/Desktop/html/test1.htm";
String toPath = @"C:\Users\Administrator\Desktop\html\test.pdf";
PdfDocument doc = new PdfDocument();
Thread thread = new Thread(()
=>
{
doc.LoadFromHTML(fromUrl, false, true, true);
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
doc.SaveToFile(toPath);
doc.Close();
}
}
}