我正在使用abcPdf将HTML报告转换为pdf文件.pdf必须是单一的横向A4页面.
你知道是否有办法告诉abcPdf扩展HTML页面以适应pdf中的单个页面?我尝试使用Magnify()方法,它会缩放内容但仍将其分解为页面,即使它适合一页.我一直在摸不着头脑,我想知道是否有人这样做过.
这是我目前正在使用的代码:
public byte[] UrlToPdf(string url, PageOrientation po)
{
using (Doc theDoc = new Doc())
{
// When in landscape mode:
// We use two transforms to apply a generic 90 degree rotation around
// the center of the document and rotate the drawing rectangle by the same amount.
if (po == PageOrientation.Landscape)
{
// apply a rotation transform
double w = theDoc.MediaBox.Width;
double h = theDoc.MediaBox.Height;
double l = theDoc.MediaBox.Left;
double b = theDoc.MediaBox.Bottom;
theDoc.Transform.Rotate(90, l, …Run Code Online (Sandbox Code Playgroud)