पर फिट करने के लिए एचटीएमएल स्केल करने के लिए बताएं मैं एक HTML रिपोर्ट को पीडीएफ फ़ाइल में कनवर्ट करने के लिए abcPdf का उपयोग कर रहा हूं। पीडीएफ एक एकल परिदृश्य ए 4 पेज होना चाहिए।एबीसीपीडीएफ को एक पीडीएफ पेज
क्या आप जानते हैं कि पीडीएफ में एक पृष्ठ पर फिट करने के लिए HTML पृष्ठ को स्केल करने के लिए abcPdf को बताने का कोई तरीका है या नहीं? मैंने Magnify() method का उपयोग करने की कोशिश की, और यह सामग्री को स्केल करता है लेकिन फिर भी इसे पृष्ठों में तोड़ देता है, भले ही यह एक पृष्ठ पर फिट होगा। मैं थोड़ी देर के लिए इस पर अपने सिर खरोंच कर रहा हूं, और सोच रहा हूं कि किसी ने इसे किया है या नहीं।
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, b);
theDoc.Transform.Translate(w, 0);
// rotate our rectangle
theDoc.Rect.Width = h;
theDoc.Rect.Height = w;
// To change the default orientation of the document we need to apply a rotation to the root page object.
//By doing this we ensure that every page in the document is viewed rotated.
int theDocID = Convert.ToInt32(theDoc.GetInfo(theDoc.Root, "Pages"));
theDoc.SetInfo(theDocID, "/Rotate", "90");
}
theDoc.HtmlOptions.PageCacheEnabled = false;
theDoc.HtmlOptions.AddForms = false;
theDoc.HtmlOptions.AddLinks = false;
theDoc.HtmlOptions.AddMovies = false;
theDoc.HtmlOptions.FontEmbed = false;
theDoc.HtmlOptions.UseResync = false;
theDoc.HtmlOptions.UseVideo = false;
theDoc.HtmlOptions.UseScript = false;
theDoc.HtmlOptions.HideBackground = false;
theDoc.HtmlOptions.Timeout = 60000;
theDoc.HtmlOptions.BrowserWidth = 0;
theDoc.HtmlOptions.ImageQuality = 101;
// Add url to document.
int theID = theDoc.AddImageUrl(url, true, 0, true);
while (true)
{
if (!theDoc.Chainable(theID))
break;
theDoc.Page = theDoc.AddPage();
theID = theDoc.AddImageToChain(theID);
}
//Flattening the pages (Whatever that means)
for (int i = 1; i <= theDoc.PageCount; i++)
{
theDoc.PageNumber = i;
theDoc.Flatten();
}
return theDoc.GetData();
}
}
क्या आपने इसे पूरा किया और इसे पूरी तरह से काम किया? –
हाय माइक या बीन किसी के पास नीचे दिए गए मुद्दे के बारे में विचार है http://stackoverflow.com/questions/22069825/abcpdf-not-showing-full-table-data – SivaRajini