Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ABCpdf PDF Component
#1
Hi Gintaras,

I saw this product "ABCpdf" from this website http://www.websupergoo.com/abcpdf-1.htm
Could you show me how to declare it and use its simplest function like to create a document file?
You can download it here:
http://www.websupergoo.com/download.htm#pd
#2
Macro ABCpdf .NET
Code:
Copy      Help
;create variable that manages compiled C# code
CsScript x
x.SetOptions("references=ABCpdf")

;compile code after #ret
x.AddCode("")

;call static function
int R=x.Call("Class1.TestFunction" _s.expandpath("$desktop$\QM ABCpdf.pdf"))
out R


#ret
//C# code
using System;
using WebSupergoo.ABCpdf9;

public class Class1
{
static public int TestFunction(string saveToThisFile)
{
Doc theDoc = new Doc();
theDoc.FontSize = 96;
theDoc.AddText("Quick Macros");
theDoc.Save(saveToThisFile);
theDoc.Clear();

return 1;
}

//add more functions here if need
}
#3
Thank you very much. It works just great!
One quick question though, could we use typelib to declare it and use
it through COM? Or do we have to use it through C# only?
#4
Macro ABCpdf COM
Code:
Copy      Help
IDispatch theDoc._create("ABCpdf9.Doc")
theDoc.FontSize = 96
theDoc.AddText("Quick Macros")
theDoc.Save(_s.expandpath("$desktop$\QM ABCpdf COM.pdf"))

;or

typelib ABCpdf {9F74D25B-CA59-48F9-B374-26CE7A34EF1B} 9.1
ABCpdf.Doc theDoc2._create
theDoc2.FontSize = 96
theDoc2.AddText("Quick Macros")
theDoc2.Save(_s.expandpath("$desktop$\QM ABCpdf COM 2.pdf"))
#5
Thank you very much, I'm impressed!
The "IDispatch" method works fine.
But the "typelib" method gives me error on the first line at "ABCpdf"
saying that "This name already exist" you have any idea?
#6
Maybe a function named ABCpdf exists, or a variable etc. You can use any name, eg typelib ABCpdf2 ....
#7
You're absolutely right! After changing its name to ABCpdf2 it works just fine.
Thank you very much for all your help on this topic. I'm really interested in this app
since it supports several languages and COM too! And most importantly QM could use most of them!
Cheers! Big Grin
#8
Could you give me an example of this in Visual Basic?
#9
Macro ABCpdf .NET VB
Code:
Copy      Help
CsScript x.SetOptions("language=VB[]references=ABCpdf")
x.AddCode("")

int R=x.Call("Class1.TestFunction" _s.expandpath("$desktop$\QM ABCpdf VB.pdf"))
out R


#ret
'VB.NET code
Imports System
Imports WebSupergoo.ABCpdf9

Public Class Class1
Public Shared Function TestFunction(saveToThisFile As String) As Integer
Dim theDoc As New Doc
theDoc.FontSize = 96
theDoc.AddText("Quick Macros")
theDoc.Save(saveToThisFile)
theDoc.Clear()

Return 1
End Function
End Class
#10
Works like a charm!
Thank you very much! Big Grin


Forum Jump:


Users browsing this thread: 9 Guest(s)