تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
انشاء ملف PDF بالفيجوال بيسك
#11
PHP كود :
What is ITextSharp iTextSharp is a free and open source assembly which helps to convert page output or html content in pdf file.

You can download from here:

http://sourceforge.net/projects/itextsharp/

Now add that dll in application.

Getting Started

Start visual studio 
and create a new website in asp.net and add these 2 dll in solution.

Itextsharp.dll

itextsharp
.pdfa.dll

add namespaces  
-

using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html;
using iTextSharp.text.html.simpleparser;

 

protected 
void btnCreatePDF_Click(object senderEventArgs e)
 
   {
 
       Document doc = new Document(PageSize.A410f10f100f0f);
 
       string pdfFilePath Server.MapPath(".") + "/PDFFiles"     
        PdfWriter writer 
PdfAWriter.GetInstance(doc, new FileStream(pdfFilePath "/Default.pdf"FileMode.Create));
 
       doc.Open();
 
       try
        
{
 
           Paragraph paragraph = new Paragraph("Getting Started ITextSharp.");
 
           string imageURL Server.MapPath(".") + "/image2.jpg";
 
           iTextSharp.text.Image jpg iTextSharp.text.Image.GetInstance(imageURL);
 
           //Resize image depend upon your need
 
           jpg.ScaleToFit(140f120f);
 
           //Give space before image
 
           jpg.SpacingBefore 10f;
 
           //Give some space after the image
 
           jpg.SpacingAfter 1f;
 
           jpg.Alignment Element.ALIGN_LEFT;
 
 
           doc.Add(paragraph);
 
           doc.Add(jpg);
 
 
       }
 
       catch (Exception ex)
 
       { }
 
       finally
        
{
 
           doc.Close();
 
       }
 
   }

Hit F5 to see output.


Image 1.

PDF file has been saved in “PDFFiles” folder under solution

المصدر : http://www.c-sharpcorner.com/Blogs/12317...sharp.aspx
سبحان الله والحمدلله ولا إله إلا الله والله أكبر
 اللهم اغْفِرْ لِلمؤمنين والمؤمنات والمسلمين والمسلمات الأحياء منهم والأموات
الرد }}}
تم الشكر بواسطة: الشاكي لله , الشاكي لله
#12
الأخ عدنان الشمري

طالما لديك الصور بالفعل تستطيع استخدام الكود الموجود في الرابط التالي و تحول جميع الصور لديك الي صورة واحدة فقط و من ثم تسعرضها كيفما شئت باستخدام PictureBox

الرابط
الرد }}}
تم الشكر بواسطة: الشاكي لله , عدنان الشمري
#13
اخي العزيز silverlight
شكرا لاهتمامك بالموضوع
ولكن احتاج برنامج يقوم بسحب عدة صور من السكنر ومن ثم تحويلها الى ملف pdf واحد
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم