PDF thumbnails from VBA
I was asked to develop a form where user can see a pdf thumbnail of a pdf file. It was pretty far from what I have been developing so I decided to use "uncle" google to find a solution. There are some solutions but nothing what was expecting. You can use paid version of Adobe or free Adobe Acrobat ActiveX (Acropdf1) or some others free tools that can work along a pdf file. I tested only the free version of Acrobat ActiveX component and it was really nightmare. Then I found a C# project using the GhostScript tool for creating a pdf thumbnail. Unfortunatelly VBA cannot work with this project directly. Read more to find solution.
As I mentioned you can use the Acropdf1 activeX which is automatically installed with the Adobe Reader application.
How to add the Acropdf1 activeX on a VBA form
At the first time the activeX seemed to be a good solution but then I found two "bugs". The first one is more important than the second one. The activeX takes focus and never give it back and if you press the "TAB" key, then the whole application will crash. It's very known bug but Adobe cannot fix it for some reason. And the second bug rather behavior - of the activeX control is uncomfortable - it always takes focus and never give it back and also you don't have option to find out if a pdf document is fully loaded or not. My client was complaining about that for many times so I decided to find another solution.
I found code from Matthew Ephraim. where he uses a free tool Ghostscrip and .NETFramework 3.5 and C#. Form Visual Studio you can use his tool without any problems just include it into your project. Unfortunately we cannot use his dll directly from VBA. That was the reason why I took his code and made a little adjustment to expose methods from his project to the COM object.
Now - after registration the dll to your system - you can reference the dll as usually and use it !!! And it works great.
Who is interested how to create a C# dll that can work with VBA I attached the zip file with entire C# solution. Look at the Attachment section.
And who just want to use it as soon as possible, download the installer and install it. I also prepare a sample and you can find everything in the Attachment section.
The installer just check if your system contains the .NETFramework 4 and if not, it will suggest to download it and then register the dlls into your system.
Your code can look like this one
and then you can take the output file as an ordinary image file and load it - for example - to an image control.
Option Explicit
'********************************************************************************
'TestPDFThumbnailGeneration
'
' Purpose: It uses reference to GhostscriptWrapper library.
' From a pdf file creates a jpg file that represents a thumbnail of the pdf.
' You can set page number and DPI quality.
'
' Inputs: -none-
'
' Outputs: -none-
'
' Created: 02/10/2011 Premysl Lazecky
'
' Modified: .
'
'********************************************************************************
Sub TestPDFThumbnailGeneration()
Dim PDF As GhostscriptWrapper
Dim strPath As String
Dim strInputFile As String
strInputFile = "Test.pdf"
strPath = ActiveWorkbook.Path
If Right$(strPath, 1) <> Application.PathSeparator Then
strPath = strPath & Application.PathSeparator
End If
Set PDF = New GhostscriptWrapper
PDF.GeneratePDFThumb inputPath:=strPath & strInputFile, _
outputPath:=strPath & "Output.jpg", _
Page:=1, _
Width:=72, Height:=72
Set PDF = Nothing
End Sub
As the result of this code you will get a jpg file called Output.jpg with thumbnail of defined page in the pdf file - in this case page 1 - with defined resolution.
Attachments
Installer and sample files
C# project
Komentáře
Přehled komentářů
Extremely user friendly site. Huge info readily available on couple of gos to. https://webofgeeks.com/pl/jak-sprawdzic-model-laptopa-w-linuksie/
Superlative Roblox Square
(Dexonguili, 22. 4. 2022 13:42)
Get best roblox exploits
https://www.youtube.com/watch?v=magqME1m7-M
next page Kevinagomy
(Kevinagomy, 21. 4. 2022 19:34)
Simply just want to say I am thrilled I came in your website. https://webofgeeks.com/fi/10-tapaa-avata-asetukset-windows-10-ssa/
this post Kevinagomy
(Kevinagomy, 20. 4. 2022 15:20)
You're an extremely practical website; could not make it without ya! https://webofgeeks.com/el/pos-na-diorthosete-auto-to-arkheio-einai-polu-megalo-gia-anakuklose-sta-windows-11/
learn here Kevinagomy
(Kevinagomy, 19. 4. 2022 19:14)
I enjoy the information on your website. Thanks for your time! https://webofgeeks.com/cs/jak-obarvit-alternativni-radky-v-tabulkach-google/
My Love Area
(Akatsuki007cah, 17. 4. 2022 6:56)
free porn
https://thepornarea.com/videos/929517/esde-th-akame-ga-k-ll-bj-riding-anal-big-tits/
https://thepornarea.com/videos/857911/squirting-fun-submissive-teen-lily-rader-squirts-from-hairy-blonde-bush/
https://thepornarea.com/videos/879589/deep-inspection-of-lola-s-pussy/
https://thepornarea.com/videos/919819/using-my-nipple-to-make-his-cock-explode/
https://thepornarea.com/videos/691288/outdoor-fuck-with-a-sexy-milf/
The Tube
As it turns out, modern times set up got nothing on the past. Erotica existed desire up front video or indeed photography, and various researchers regard as phylogeny predisposed humans as a service to visual arousal (It's a lot easier to pass on your genes if the cool of other in one's birthday suit humans turns you on, after all). Whichever at work you slice it, the discrepancy of pornographic materials throughout history suggests that generous beings clothed always been interested in images of sex. Lots and lots of sex.
Szybkie Randki Warszawa
(belleDriex, 11. 4. 2022 23:13)
https://sc.districtcouncils.gov.hk/TuniS/randkionline.info
Randki Radom
Randki Toruń
nowe mieszkania w augustowie
(Trigoocaift, 11. 4. 2022 16:02)
<a href="https://www.pokojeiaugustow.online">https://www.pokojeiaugustow.online</a href> noclegi w augustowie centrum
stx21
Are you 18? Come in and don't be shy!
(loveawake.ru, 8. 4. 2022 17:57)Welcome to the world of adult Dating loveawake.ru
fun casino bonus code
(MixClots, 4. 4. 2022 11:19)
https://forum.proxmox.com/members/limaofep.141182/#about
play ojo casino
Nicest Roblox Place
(Dexonguili, 3. 4. 2022 3:58)
Hello, here you can find roblox glitches and more.
https://century21royaltors.com/survive-the-night-script/
black lotus casino no deposit bonus codes 2022
(belleDriex, 29. 3. 2022 23:23)
https://bukkit.org/members/limaoheads.91398935/
all british casino
no minimum deposit casino
Best Roblox Zone
(Dexonguili, 29. 3. 2022 3:31)
Hello, here you can on roblox bugs and more.
https://parkhillpresbyterian.org/counter-strike-roblox-offensive-hacks-aimbot-esp/
The fate of the old man
(JanetikEnund, 28. 3. 2022 22:30)
Each generation sees itself as completely different from the previous one, but in the end is about the same.
If I look at my own life, I believe that I have made mistakes many times.
The same will happen to you when you get older. Live and make mistakes. This is life.
Do not flatter yourself that you are capable of being perfect - this is not real.
Strengthen your spirit, your qualities, so that when a test happens, you find the strength to accept it like a real man.
Do not let yourself be fooled by common facts and loud phrases.
Travel countries, explore the world, meet people, do something that excites you, fall in love, be bold, but do it with passion.
The most important thing is to live life with taste.
There is probably more than one life waiting for us. But to get them, you need to spend this life to the end. Take everything you can from life.
Fear colorless fate.
Nicest Roblox Charge
(Dexonguili, 28. 3. 2022 3:10)
Hello, here you can find roblox cheats and more.
https://lospiritodiassisi.org/script-for-adopt-me/.html
Share of personality
(RachellPag, 28. 3. 2022 0:50)
Teaching the old to the young is not only a waste of time, but also impudence https://skvoter.smartphon.design .
Each generation sees itself as completely different from the previous one, although in the end it turns out to be almost the same.
If I look at my own life, I see that I have often been wrong.
The same will happen to you when you get older. Enjoy life and make mistakes. This is life.
Do not argue that you are capable of being perfect - it is not real.
Temper yourself, your will, so that when the test comes, you will find the strength in yourself to meet him as a true man.
Do not allow yourself to be deceived by obvious facts and noisy phrases.
Travel, explore the world, meet people, do something that interests you, fall in love, be daring, but do it with inspiration.
The most important thing is to live life with taste.
Maybe we have more than one life ahead of us. But to get them, you need to use this life to the fullest. Take as much from life as you can.
Fear colorless fate.
A-one Roblox Put away
(Dexonguili, 27. 3. 2022 1:54)
Hello, here you can espy roblox cheats and more.
https://chicagoweddings.org/working-roblox-exploit-november-2022/
Nicest Roblox Associate
(Dexonguili, 25. 3. 2022 1:30)
Hello, here you can tumble to roblox hacks and more.
https://evergreenmedicalcentre.com/roblox-teleport-exploit-2022/.html
https://evergreenmedicalcentre.com/is-impact-roblox-exploit-safe/.html
https://evergreenmedicalcentre.com/roblox-hacks-with-full-tutorial-on-how-to-donload/.html
Superlative Roblox Neighbourhood
(Dexonguili, 24. 3. 2022 1:06)
Hello, here you can on roblox cheats and more.
https://mrbcny.org/roblox-how-to-make-a-level-7-exploit/.html
https://mrbcny.org/roblox-hacks-no-servay/.html
https://mrbcny.org/jjsploit-password-stolen/.html
Nicest Roblox Plunk down
(Dexonguili, 23. 3. 2022 21:24)
Hello, here you can on roblox cheats and more.
https://joedev.net/run-synapse-x-comman/.html
https://joedev.net/entry-point-script/.html
https://joedev.net/roblox-how-to-install-wearedevs-hacks/.html
https://joedev.net/toyo-proxo-r888/.html
https://joedev.net/is-roblox-hacks-2022-safe/.html
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50
her response Kevinagomy
(Kevinagomy, 22. 4. 2022 14:48)