fayrehouse
12 years agoFrequent Contributor
Can anyone help translate C# to Jscript for use within TC?
Hi All,
I've added a DLL to the CLR bridge, and am now trying to translate some sample code written in C# into jScript for use within TC. But I'm a bit stuck.
Original C# snippet:
const int pageNumber = 1;
PdfReader pdf = new PdfReader(pdfFile);
PdfDictionary pg = pdf.GetPageN(pageNumber);
PdfDictionary res = (PdfDictionary)PdfReader.GetPdfObject(pg.Get(PdfName.RESOURCES));
PdfDictionary xobj = (PdfDictionary)PdfReader.GetPdfObject(res.Get(PdfName.XOBJECT));
What I have so far:
var pdfFile = "c:\\myfile.pdf";
var pageNum = 1;
var pdf = dotNET.iTextSharp_text_pdf.PdfReader(pdfFile)
var pg = dotNET.iTextSharp_text_pdf.PdfDictionary(pageNum)
var res = ????
var xobj = ????
so basically, I'm stuck on the last 2 lines of the C#. I can tell you that pdfName is a class within the iTextSharp_text_pdf namespace, with 3 constructor overloads. and (amongst others) the above statics RESOURCES and XOBJECT.
Can anyone offer guidance?! :)
Thanks :)
Steve
I've added a DLL to the CLR bridge, and am now trying to translate some sample code written in C# into jScript for use within TC. But I'm a bit stuck.
Original C# snippet:
const int pageNumber = 1;
PdfReader pdf = new PdfReader(pdfFile);
PdfDictionary pg = pdf.GetPageN(pageNumber);
PdfDictionary res = (PdfDictionary)PdfReader.GetPdfObject(pg.Get(PdfName.RESOURCES));
PdfDictionary xobj = (PdfDictionary)PdfReader.GetPdfObject(res.Get(PdfName.XOBJECT));
What I have so far:
var pdfFile = "c:\\myfile.pdf";
var pageNum = 1;
var pdf = dotNET.iTextSharp_text_pdf.PdfReader(pdfFile)
var pg = dotNET.iTextSharp_text_pdf.PdfDictionary(pageNum)
var res = ????
var xobj = ????
so basically, I'm stuck on the last 2 lines of the C#. I can tell you that pdfName is a class within the iTextSharp_text_pdf namespace, with 3 constructor overloads. and (amongst others) the above statics RESOURCES and XOBJECT.
Can anyone offer guidance?! :)
Thanks :)
Steve