منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
انشاء ملف PDF بالفيجوال بيسك - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : انشاء ملف PDF بالفيجوال بيسك (/showthread.php?tid=1051)

الصفحات: 1 2


RE: انشاء ملف PDF بالفيجوال بيسك - أبو عمر - 07-11-15

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/add-image-in-pdf-using-itextsharp.aspx



RE: انشاء ملف PDF بالفيجوال بيسك - silverlight - 07-11-15

الأخ عدنان الشمري

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

الرابط


RE: انشاء ملف PDF بالفيجوال بيسك - عدنان الشمري - 07-11-15

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