Merhabalar,
Hepimizin çok ihtiyacı olan bir konu sanırım. Herhangi bir dosyayı, bir URL’in içeriğini ya da içeriğini bizim belirleyebileceğimiz pdf dosyaları yapmak isteyebiliriz. Bu konu ile ilgili birkaç hazır component var. Ben de bunlardan WebSupergoo‘nun ABCpdf7 componentini kullanarak örnek yaptım.
Hello,
I think the issue is a need for all of us. We may want to create pdf files from a file, an Uri’s content or own customization. There are a few components to do that. I used WebSupergoo‘s ABCpdf7 component to creae this example.
using (WebSupergoo.ABCpdf7.Doc pdfDocument = new WebSupergoo.ABCpdf7.Doc())
{
//theDoc.Rect.Inset(0, 0);
pdfDocument.Page = pdfDocument.AddPage();
int pageId = pdfDocument.AddImageUrl("http://www.google.com.tr/"); // Herhangi bir sitenin anasayfasının ekran görüntüsünü alıyorum. Ancak site içeriğinin uzunluğunu bilemeyebiliriz. O yüzden az sonra aşağıda görüntüyü sayfalara böleceğiz.
// I want to get a screen shot from any web site. Maybe we don't have any idea about the page length that's why we seperate the picture to pages.
while (true)
{
pdfDocument.FrameRect();
if (!pdfDocument.Chainable(pageId))
break;
pdfDocument.Page = pdfDocument.AddPage();
pageId = pdfDocument.AddImageToChain(pageId);
}
for (int i = 1; i <= pdfDocument.PageCount; i++)
{
pdfDocument.PageNumber = i;
pdfDocument.Flatten();
}
string pdfFilePath = "testpdffile.pdf";
pdfDocument.Save(pdfFilePath);
pdfDocument.Clear();
}
Advertisement

Dostum sen bu makale ile cennete bilet aldığının farkında mısın?
ya bunu nası yapcaz kütüphaneyi bi bulup kullanamadım bir örneğini koyarmısınız?
örneği biraz daha açıklarmısınız
çalıştıramadım
(bu konu gerçekten çok önemli)
İlgili siteden programı(dll’leri pc’inize kopyalayın) indirdikten sonra dll’leri projenize referans olarak ekledikten sonra yukardaki kodu kopyalarak yapabilirsiniz. Gerisi yani geliştirilmesi size kalmış.
Kolay gelsin.