الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف يمكن تحويل الصوره الى Pdf

بدأه super2006 في 30 أبريل 2009 · 6 رد · 847 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمته وبركاته

اخوتي الكرام امامكم كود لعمل داونلوود لصوره من على الصفحه اريد ان اعرف كيف يتم تحويل الصوره الى pdf

protected void DownloadBTN_Click(object sender, EventArgs e)

{

string filename = "Winter.jpg";

// set the http content type to "APPLICATION/OCTET-STREAM

Response.ContentType = "APPLICATION/OCTET-STREAM";

// initialize the http content-disposition header to

// indicate a file attachment with the default filename

// "Access.mdb"

string disHeader = "Attachment; Filename=\"" + filename + "\"";

Response.AppendHeader("Content-Disposition", disHeader);

// transfer the file byte-by-byte to the response object

FileInfo fileToDownload = new FileInfo("~/Picture/Winter.jpg");

Response.Flush();

Response.WriteFile(fileToDownload.FullName);

}

الكود مظبوت مره اخره

protected void DownloadBTN_Click(object sender, EventArgs e)

{

string filename = "Winter.pdf";

// set the http content type to "APPLICATION/OCTET-STREAM

Response.ContentType = "APPLICATION/OCTET-STREAM";

// initialize the http content-disposition header to

// indicate a file attachment with the default filename

// "Access.mdb"

string disHeader = "Attachment; Filename=\"" + filename + "\"";

Response.AppendHeader("Content-Disposition", disHeader);

// transfer the file byte-by-byte to the response object

FileInfo fileToDownload = new FileInfo("~/Picture/Winter.jpg");

Response.Flush();

Response.WriteFile(fileToDownload.FullName);

}

#2

خسارة مفيش رد كنت اتمنى انه يكون في رد

#3

لا توجد طريقة جاهزة للتحويل إلى PDF. يجب عليك استخدام component خاص للقيام بهذا (معظمها غير مجانية)

#4

جزيت الجنه ولكني متأكد ان في طريقه ولكن نفسي اعرفها ازاي

#5

اعتقد ان اللى بيعمل الموضوع ده

PDFSharp API

ItextSharp API

free and open source

أُحبُّ الصَّالِحِينَ وَلسْتُ مِنْهُمْ ××× لَعَلِّي أنْ أنَالَ بهمْ شَفَاعَهْ

وَأكْرَهُ مَنْ تِجَارَتُهُ المَعَاصِي ××× وَلَوْ كُنَّا سَواءً في البضَاعهْ

#6

شغاله وبتحول

حمل API من هنا

http://sourceforge.net/project/showfiles.p...lease_id=609105

وبعد تحميلها فك الضغط هتلاقى مشروع اسمه Based on GDI

وده المسار بتاعة

MigraDoc\samples\Samples C#\Based on GDI

بداخل الsolution هتلاقى اتكتر من مشروع اجعل images project هو startup project

وما عليك الا ان تعطيله مسار الصوره من خلال هذا السطر

section.AddImage("../../SomeImage.png");

بالتوفيق

أُحبُّ الصَّالِحِينَ وَلسْتُ مِنْهُمْ ××× لَعَلِّي أنْ أنَالَ بهمْ شَفَاعَهْ

وَأكْرَهُ مَنْ تِجَارَتُهُ المَعَاصِي ××× وَلَوْ كُنَّا سَواءً في البضَاعهْ

#7

جزاك الله خيرا اخي ان شاء الله هجرب واشوف

مواضيع مشابهة