iTextSharp is not COM ready and never will. You can write a .NET COM wrapper 
that could call iTextSharp but that's quite a task for limited functionality, 
it may work for your purpose, though.

Paulo

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: Monday, January 31, 2011 3:32 PM
To: [email protected]
Subject: [iText-questions] iText/VBA issue

Hi all,
I need to setup a simple routine in VBA/Access (2003 or 2007), which opens
an already existing PDF, writes a text extra line with some simple
formatting at a specificed position (in Word I would use a text box) with
data taken from an underlying Access query, and then opens Adobe Reader for
further actions by the user.
I thought to use iTextSharp to modify PDF, but I had problems at the very
beginning.
Since it is a .NET library, I registered iTextSharp.dll with: RegAsm
iTextSharp.dll /tlb:iTextSharp.tlb /codebase. Regasm I used is from .NET
Framework 4(4.0.30319.1), and my OS is Win7/64 on AMD. I got approx a dozen
warning for generic types. Then I opened Access 2007 and set the reference
to iTextSharp.tlb.
Then just in order to see everything was ok, i tried:

Private Sub PDFButton_Click()
    Dim pdfTemplate As String
    pdfTemplate = "C:TmpD0001.PDF"
    Dim TestClass As pdfReader
    Set TestClass = pdfReader(pdfTemplate)

The rest was not developed because the execution always stops at the last
row with the error: Function or Sub not defined.
I realized, by opening the Object window in VB, that any class included by
iTextSharp has no member at all.
Therefore my question is:
1) Was I wrong by choosing the initial procedure (to make iTextSharp usable
by VBA/Access)?
2) If I was not wrong, is it that the assembly registration was essentially
not successful? If true, why?

I am wondering if this could be due to the generic types signalled by
regasm. In this case the reason would be inside the code, as far as I can
see. Is there a way to let iTextSharp correctly expose its classes to COM
environment?

Thanks for any help, which will be greatly appreciated.
 Marco B.



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to