On Friday, July 31, 2020 at 7:33:58 AM UTC-6,
internet...@foobox.com wrote:
> For many years I have used Stephen Lebans ReportToPdf that has worked well until now.
Yes, a lot of us used that utility. and before Access/Office 2007, we also used his PDF creator.
Thankfully, now (even with runtime) we can create PDF's from Access - even the runtime, and NOT require any PDF drivers or even software to be installed - nice!
>
> I am needing to transfer the system to 64 bit Windows and the library StrStorage.dll fails to load.
All recent versions of windows (for quite a long time name) have be OS x64 bits.
However, until rather recent, office installs remained x32 bits.
> I am not that familiar with the workings of libraries but I am assuming that MergePDFDocuments in a function within the StrStorage.dll
It was in one of the two .dll's, can't remember. However that .dll is a x32 bit windows .dll.
> I have downloaded what I think is a newer version of StrStorage.dll but it fails to load.
> hLibStrStorage = LoadLibrary(CurrentDBDir() & "StrStorage.dll")
> The file exists and is in the correct place
>
> I am assuming that it is for 32 bit systems.
You are correct. It is a win x32 bit file. Since you now using VBA and office x64 bits?
Then of course you can't use those .dll's anymore.
And the wonderful Stephan's? He not been around the access scene for a good 13 or more years.
> Has anyone any knowledge of this?
Yes, I very much know this stuff!
>
> Is there another way of merging pdf documents without buying the full version of Acrobat?
Yes, I created a .net .dll that can work with x32 or x64 bits.
I also use the "load library" approach that Stephan used for his PDF stuff.
I just simply don't have the time to correctly put up a web page.
But I have a loader, one for x64 bits, and one for x32.
This loader can load any .net .dll. For .net, x32 or x64 bits does NOT matter (if the code was compiled using ANY CPU).
However the loader must match.
To use:
You have to place the .dll nloader and the Pmerge.dll in your front end folder (same as PDF merge).
Now since the two loader.dll's are VERY small, then you might as well make a habit of placng both in the folder.
So, we have a total of 3 files:
nloader.dll - x32 bit loader
nloader64.dll - x64 bit loader
Pmerge.dll - new .net PDF merge
So, place the above 3 files in the folder.
The VBA code to merge is now this:
Dim MyPdf As Object
Set MyPdf = CreateObjectNET("Pmerge.dll", "Pmerge.Pmerge")
MyPdf.Add "c:\test4\p1.pdf"
MyPdf.Add "c:\test4\p2.pdf"
MyPdf.OutPutDoc = "c:\test4\P1ANDP2.pdf"
MyPdf.Merge
So, I only merged 2 files, but you can have 2 or 10 files.
There is also a
MyPdf.Clear
That just clears out the files if you want to merge again (and if you JUST created the MyPDF object, then no need for clear.
So, only 3 tiny .dll's.
And it AUTOMATIC works for x32 or x64 - you don't have to do anything or change the code. It will work for both x32 and x64.
the example assumes Access 2010 or later (I have the VBA test for x64 bits - so, if for SOME strange reason someone wants to use this in a pre-access 2010? It WILL work fine, but you have to remote the #Win64 test/check I have, since only 2010 and later has this built in test/check in VBA for x32/x64.
You can download from my skydrive - it is a sample accDB and the above 3 .dll's.
To use in YOUR application? You just need to import the ONE code module.
(NetLoader).
So, this example:
Super easy, super simple to use.
No registration, no installer.
It just works.
Here is a skydrive link to the zip file - do try it - perhaps post back. As I stated I don't have time to write up a web page. So, you have to just take your time, and look at the sample code. However, the sample code above is all you really need.
Please do give it a try, and at least throw the community a dog bone here that this worked for you.
Link:
https://1drv.ms/u/s!Avrwal_LV4qxhphvq4_Ce9EmZFMbEA?e=Je7dmU
Now, the above is actually based on PDFSharp - it has MANY cool features:
Modify, merge, and split existing PDF files. However, I have only exposed the merge feature, but there are quite a fw more features that I could "just" expose.
Good luck! - post back if this works for you.
Albert D. Kallal (Access MVP 2003-2017)
Edmonton, Alberta Canada
pleaseNoS...@msn.com