- הוסף לסימניות
- #21
צירפתי קוד שמצאתי פעם באינטרנט
וממשתי בעבודה
עבד מצוין
צריך להוסיף גם את הDLL שלו הוא חינמי
תגללי HiQPdf
מקווה שעזרתי
וממשתי בעבודה
עבד מצוין
צריך להוסיף גם את הDLL שלו הוא חינמי
תגללי HiQPdf
מקווה שעזרתי
קוד:
Imports HiQPdf
Private Function ExportPdf()
Dim htmlCode As String = ""
Dim sb As StringBuilder = New StringBuilder()
Panel17.RenderControl(New HtmlTextWriter(New StringWriter(sb)))
htmlCode = sb.ToString()
Dim htmlToPdfConverter As HtmlToPdf = New HtmlToPdf()
'// set browser width
'htmlToPdfConverter.BrowserWidth = Int.Parse(textBoxBrowserWidth.Text);
'// set browser height if specified, otherwise use the default
'If (textBoxBrowserHeight.Text.Length > 0) Then
'htmlToPdfConverter.BrowserHeight = Int.Parse(textBoxBrowserHeight.Text);
'// set HTML Load timeout
'htmlToPdfConverter.HtmlLoadedTimeout = Int.Parse(textBoxLoadHtmlTimeout.Text);
'// set PDF page size And orientation
htmlToPdfConverter.Document.PageSize = PdfPageSize.A4
htmlToPdfConverter.Document.PageOrientation = PdfPageOrientation.Landscape
'// set PDF page margins
htmlToPdfConverter.Document.Margins = New PdfMargins(0)
'// set a wait time before starting the conversion
'htmlToPdfConverter.WaitBeforeConvert = Int.Parse(textBoxWaitTime.Text);
'// convert HTML to PDF
Dim pdfBuffer As Byte() = Nothing
Dim baseUrl As String = ""
' // convert HTML code to a PDF memory buffer
pdfBuffer = htmlToPdfConverter.ConvertHtmlToMemory(htmlCode, baseUrl)
'HttpContext.Current.Response.AddHeader("Content-Type", "application/pdf")
''// let the browser know how to open the PDF document, attachment Or inline, And the file name
'HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("{0}; filename=test.pdf; size={1}", "attachment", pdfBuffer.Length.ToString()))
'' // write the PDF buffer to HTTP response
'HttpContext.Current.Response.BinaryWrite(pdfBuffer)
'' // call End() method of HTTP response to stop ASP.NET page processing
'HttpContext.Current.Response.End()
End Function
הנושאים החמים



Reactions: אבסולוט פרימה בלרינה, חלומות ירוקים, Harmonyapro ועוד 113 משתמשים116 //