albert albert

albert albert

  • NA
  • 524
  • 0

Create PDF via Webservice

Mar 19 2014 4:22 AM
Hi Everybody,
 
I want to create PDF via Webservice:
 
this is the webservice method:
 
[code]
 
Public Function CreatePDFWithUrl(ByVal Url As String, ByVal Landscape As Boolean, ByVal Width As Integer, ByVal Height As Integer, ByVal BrowserWidth As Integer) As <System.Xml.Serialization.XmlElementAttribute(DataType:="base64Binary")> Byte()
Dim results() As Object = Me.Invoke("CreatePDFWithUrl", New Object() {Url, Landscape, Width, Height, BrowserWidth})
Return CType(results(0),Byte())
End Function
[/code] 
 
AND this is the method:
 
[code]
 
Dim filesForPDFF As New List(Of FileForPDF) 'Iv add this
Dim aFiles As New List(Of String) 'iv add this
Dim pdfok As New Relyon_References.PDFServicesClass(AdminKey)
Dim filesForPDF As New List(Of Relyon_References.PDFServicesClass())
For Each f As String In aFiles
If File.Exists(f) Then
Dim fileFrPDF As New Relyon_References.PDFServicesClass
Dim pdffiles As New FileForPDF
fileFrPDF.CreatePDFWithUrl(filesForPDF.ToString(), True, 0, BrowserWidth, PaperSize) = f
pdffiles.FileContent = File.ReadAllBytes(f)
'filesForPDF.Add(fileFrPDF)
filesForPDFF.Add(pdffiles)
'Clean up
'File.Delete(f)
End If
Next
[/code] 
 
Thank you 

Answers (3)