Print Page | Close Window

regsvr32 & WIn7 + VBA

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1499
Printed Date: 23 Nov 24 at 12:27AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: regsvr32 & WIn7 + VBA
Posted By: grobnik
Subject: regsvr32 & WIn7 + VBA
Date Posted: 22 Jun 10 at 12:54PM
Hi Guy,
pls somebody could help me in this issue ?

I'm using windows 7 and I would like to use quick pdf libray trial version, question I have to use the regsvr32.exe followed by the path of  quick pdf libray DLL's ?. Whenever I'm trying to do this I'll receive an error from windows ! the path it's correct and the dll name too.

2nd Issue : Somebody could indicate me If I can use Quick PDF Library in combination with VBA for example AUtocad 2011 or later ? I created a macro which crate several pdf file, and I would like to merge in a unique pdf document, so I'm trying to use quick pdf library function.

Thank you



Replies:
Posted By: Ingo
Date Posted: 22 Jun 10 at 3:43PM
Hi Nik!

If you're using the "normal" dll there's no need to register with regsvr32 'cause there isn't an entry-point (like in many other dlls).
Keep in mind that QuickPDF comes in different versions: ActiveX, Delphi, normal DLL...
QP is a normal dll and VBA is able to work with dlls - so you can do the merge with QP.

Cheers and welcome here,
Ingo




Posted By: grobnik
Date Posted: 22 Jun 10 at 4:24PM
Originally posted by Ingo Ingo wrote:

Hi Nik!

If you're using the "normal" dll there's no need to register with regsvr32 'cause there isn't an entry-point (like in many other dlls).
Keep in mind that QuickPDF comes in different versions: ActiveX, Delphi, normal DLL...
QP is a normal dll and VBA is able to work with dlls - so you can do the merge with QP.

Cheers and welcome here,
Ingo
 

Thank you for your answer, could you indicate me if I have to declare somewhere the DLL as a Class library ?. I saw several code examples, but I'm not so skilled with Active X & so On.

Thank you



Posted By: grobnik
Date Posted: 22 Jun 10 at 6:34PM
Dim InstanceID As Long
InstanceID = QuickPDFCreateLibrary()
If (QuickPDFUnlockKey(InstanceID, "regnumber") = 1) Then
    IDIST = QuickPDFReleaseLibrary(InstanceID)
    
MyPath = ThisDrawing.Path & "\*F*.pdf"   ' Set the path.
Myname = Dir(MyPath, vbDirectory)    ' Retrieve the first entry.
Do While Myname <> ""    ' Start the loop.
    ' Ignore the current directory and the encompassing directory.
    If Myname <> "." And Myname <> ".." Then
    xx = QuickPDFAddToFileList(InstanceID, "MyListName", Myname)
    nn = QuickPDFFileListCount(InstanceID, "MyListName")
    zz = QuickPDFMergeFileList(InstanceID, "MyListName", "MyFile.pdf")
          Debug.Print Myname    ' Display entry only if it
    End If    ' it represents a directory.
        Myname = Dir    ' Get next entry.
Loop 
End If
End Sub

pls could you help me ? I'm trying to add several pdf file in one, so I'm trying to create a file list, then I check the count of file in the file list, and then merge together, but with-out success.
The return of file count is zero, the same for the filelist ?

What's wrong ?
Thank you


Posted By: Ingo
Date Posted: 22 Jun 10 at 7:06PM
Hi!

Why not try the knowledgebase article from the official support pages?
It's all there... how working with a dll... merging files...
Again: why not reading?

Cheers, Ingo



Posted By: grobnik
Date Posted: 22 Jun 10 at 7:28PM
Pls do not blame me, even If I'm newbie of this forum, I already use several others forums ?!

In any case thank you for your suggestion, I already read that section and I didn't find the solution, or nothing that I already done in my code.

Just a question do you know if the trial version of quick pdf library has some functionality limitation ?

Thank you.


Posted By: Wheeley
Date Posted: 23 Jun 10 at 4:40AM
To use this method, all the PDFs must not have any security on them. So check if your PDFs have security. Second, as written your code will never work. The merge function needs more then 1 file on the list to work. Try this:

Myname = Dir(MyPath, vbDirectory)    ' Retrieve the first entry.
Do While Myname <> ""    ' Start the loop.
    ' Ignore the current directory and the encompassing directory.
    If Myname <> "." And Myname <> ".." Then
    xx = QuickPDFAddToFileList(InstanceID, "MyListName", Myname)
    nn = QuickPDFFileListCount(InstanceID, "MyListName")
          Debug.Print Myname    ' Display entry only if it
    End If    ' it represents a directory.
        Myname = Dir    ' Get next entry.
Loop
zz = QuickPDFMergeFileList(InstanceID, "MyListName", "MyFile.pdf")


Wheeley


Posted By: Ingo
Date Posted: 23 Jun 10 at 6:23AM
Hi!

The testversion doesn't have any functional limitations
as lon as you're using a valid (test-)key to unlock the lib first.

Cheers, Ingo



Posted By: grobnik
Date Posted: 23 Jun 10 at 8:17AM
Originally posted by Wheeley Wheeley wrote:

To use this method, all the PDFs must not have any security on them. So check if your PDFs have security. Second, as written your code will never work. The merge function needs more then 1 file on the list to work. Try this:

Myname = Dir(MyPath, vbDirectory)    ' Retrieve the first entry.
Do While Myname <> ""    ' Start the loop.
    ' Ignore the current directory and the encompassing directory.
    If Myname <> "." And Myname <> ".." Then
    xx = QuickPDFAddToFileList(InstanceID, "MyListName", Myname)
    nn = QuickPDFFileListCount(InstanceID, "MyListName")
          Debug.Print Myname    ' Display entry only if it
    End If    ' it represents a directory.
        Myname = Dir    ' Get next entry.
Loop
zz = QuickPDFMergeFileList(InstanceID, "MyListName", "MyFile.pdf")


Wheeley

Thank you for your answer but I'm receiving always 0 (zero) from any function that I call ! I cannot understand. I got the IstanceID in this way, as suggested from quick pdf web site:

Dim InstanceID As Long
InstanceID = QuickPDFCreateLibrary()
If (QuickPDFUnlockKey(InstanceID, "YOUR KEY ...") = 1) Then
    IDIST = QuickPDFReleaseLibrary(InstanceID)

even if I use the IDIST variable (calling the function) or I use IstanceID variable the return value it's alway zero.
I tried to use any other simple function, eg create a buffer, the problem it's the same.

Does somebody never used before this procedure with VBA (visual basic for application) ? probably there is some incompatibility. But in this case, I should receive an error calling any type of function inside the DLL !? isn't true ?
 I asked also to main support in the FAQ on QP web site, i'm waiting for an answer.

Than you again


Posted By: Ingo
Date Posted: 23 Jun 10 at 9:08AM
Hi!

There aren't any problems with VBA.
QuickPDF can be used with VBA, too.
If you need further informations in this case
you should try the official support-pages.
I think here you'll find what you need:
http://help.quickpdflibrary.com/search?q=VBA

Cheers, Ingo



Posted By: grobnik
Date Posted: 23 Jun 10 at 3:57PM
Seems that the problem with ActiveX has been solved, now I have to solve some issues with document merge.
The function ask a document ID, if I have a AddToFileList with a listName already populated of document name (pls note that documents are not opened there is only a list getting from a specific dir function), how I can get each docID ?, I insert the function to get the document ID in the loop that get the file name, but only the first return and ID.

Any suggestion will be accepted.


Posted By: grobnik
Date Posted: 23 Jun 10 at 6:36PM
Originally posted by grobnik grobnik wrote:

Seems that the problem with ActiveX has been solved, now I have to solve some issues with document merge.
The function ask a document ID, if I have a AddToFileList with a listName already populated of document name (pls note that documents are not opened there is only a list getting from a specific dir function), how I can get each docID ?, I insert the function to get the document ID in the loop that get the file name, but only the first return and ID.

Any suggestion will be accepted.

Problem solved, there was a problem with unlock code.
Just another question why the layer inside each document will be not stored in the merged file ?


Posted By: Ingo
Date Posted: 23 Jun 10 at 11:37PM
Hi!

Try CombineLayers before... perhaps it helps.

Cheers, Ingo


Posted By: grobnik
Date Posted: 24 Jun 10 at 7:26AM
Thank you, but reading the function specification seems that combine the layer on the same page, my scope will be to combine pages with each one own layer and bookmarks.

I read something in the knowledge base web site and seems that the bookmarks are not supported by QUICK PDF, I'll search better.

Ciao


Posted By: Ingo
Date Posted: 24 Jun 10 at 8:49AM
Hi!

Another question could be what will happen if
you're merging two files with layer 1 to a new
targetfile... How the new layer 1 would look like ;-)
Try it and share your new knowledges here.

Cheers, Ingo


Posted By: grobnik
Date Posted: 24 Jun 10 at 9:12AM
I'll try to answer to your question:

1) If I combine pdf files with adobe acrobat, it's combine also the layer and bookmarks of each file, even if you have the same layer name in each file.

2) If I combine file with QP 7.19 with AddFilelist & MergeFileList functions and SaveToFile the final final contain only the bookmarks and the layer of the first page.

I hope this could help you to understand the problem

I don't know how to attach here a file, this could help you more.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk