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ářů
cheapest sildenafil australia https://eunicesildenafilcitrate.com/ buy generic 100mg viagra
vegavardenafil
(vardenafil 20mg dosage, 7. 4. 2021 13:13)vardenafil- vardenafil tablet, film coated https://vegavardenafil.com/ levitra vardenafil 40 mg
elitadalafill
(tadalafil 40 mg daily, 5. 4. 2021 23:47)what is tadalafil https://elitadalafill.com/ tadalafil pills
TilsPlosyIcojemiwele
(Jamiesycle, 5. 4. 2021 13:30)
https://telegra.ph/Daddy-Fucks-Son-Gifs-03-31
https://telegra.ph/Brynn-Tyler-HD-Porn-03-29
https://telegra.ph/Trio-Lezzies-Having-Fun-In-The-Bathroom-03-29
https://telegra.ph/Adault-Porno-Teen-Hard-Crying-Images-03-25
https://telegra.ph/Studenten-Girls-Fotos-Naked-11-07
https://telegra.ph/Shelby-Chong-Young-Nude-04-01
https://telegra.ph/Super-Curvy-Appetizing-Kyra-Hot-Is-Ready-To-03-30
https://telegra.ph/Masseur-Slams-His-Dick-In-Gina-ValentinaS-Hairy-03-27
https://telegra.ph/Calum-Best-Full-Sex-04-04
https://telegra.ph/Blonde-Naked-Suicide-Girls-03-24
https://telegra.ph/Chuby-Tee-Sex-Pict-Free-Downlod-03-26
https://telegra.ph/Anal-Sex-Video-Clip-04-01
https://telegra.ph/Girls-Finger-Naked-Girls-03-24
https://telegra.ph/Two-Young-Married-Couples-Switch-Partners-03-27
https://telegra.ph/Ae-King-Hentai-Quality-Porno-11-06
https://telegra.ph/Rated-R-Pinays-Nackt-Pics-11-02
https://telegra.ph/Blowing-Young-Teen-Porn-Videos-03-28
https://telegra.ph/Japanese-Naked-Geisha-Fuck-04-01
https://telegra.ph/Fat-Girls-Getting-Fucked-By-Machines-04-04
https://telegra.ph/Young-Teen-Porn-Video---Kisses-For-Kacy---Part-5-03-28
https://telegra.ph/Gorgeous-Blonde-Performs-Cool-College-Blowjob-03-29
https://telegra.ph/Fuck-My-Wife-For-Cash-03-22
https://telegra.ph/Alice-Gorgeous-Blonde-Girlfriend-Slow-Erotic-Sex-03-27
https://telegra.ph/Ex-Girlfriend-Latina-Naked-04-01
https://telegra.ph/The-Looking-Glass-03-28
https://telegra.ph/Taxas-Patti-11-01
https://telegra.ph/Nicole-Coco-Ass-Porn-Pictures-04-04
https://telegra.ph/Ashden-Breeze-HD-Porn-03-29
https://telegra.ph/Punjabi-Girl-Boy-Free-School-Sex-11-06
https://telegra.ph/Mädchen-Mit-Großen-Nackt-Booties---Porno-Foto-11-04
https://telegra.ph/Aubrey-Lee-HD-Porn-03-30
https://telegra.ph/Cholo-With-His-Girl-Nude-03-25
https://telegra.ph/At-Home-Milf-Ass-11-12
https://telegra.ph/Dating-Zeitung-Anzeigen-11-06
https://telegra.ph/Nude-Lady-Liking-Her-Nipple-03-26
https://telegra.ph/
https://telegra.ph/Maggie-Mayhem-Porn-03-31-2
https://telegra.ph/Domina-Geschichten-11-01
https://telegra.ph/Naughty-America-Nackte-Girls-11-02
https://telegra.ph/Horny-Nurse-In-Fake-Hospital-Wants-To-Fuck-04-01
https://telegra.ph/Nackte-Frauen-Fannys-Geleckt-Werden-11-03
https://telegra.ph/Teen-Female-Blonde-Hot-04-02
https://telegra.ph/Suck-Old-Men-Sex-03-27
https://telegra.ph/Dating-Websites-Usernames-03-24
https://telegra.ph/Hillary-Fisher-Porno-Star-03-26
https://telegra.ph/Youporncom-11-01-15
https://telegra.ph/Vanessa-Hudgens-U-Close-Pussy-03-26
https://telegra.ph/Uncle-And-Girl-Sex-Photo-11-09
https://telegra.ph/Young-Fatties-Pussy-Nackt-11-02
https://telegra.ph/Hardcore-Pamila-Anderson-Photo-03-26
tocovid
(AngelRoumn, 28. 3. 2021 4:23)asokoro general hospital https://fmohconnect.gov.ng/
List of best online forex brokers
(ForexPsync, 16. 3. 2021 1:41)En iyi forex ticaret kitapları. https://tr.forex-trading-is.com
Divorce
(Sew, 4. 1. 2021 22:54)
A freelancer features writer for high women's publications is now on the lookout forto share with you their very own tales about divorce to offer subscribers information. .
https://free-divorce-advice.com/california/whats-does-a-signature-mean-when-it-has-without-prejudice-ucc-1-308/
How To Buy Tiktok Likes 2021
(MixClots, 23. 12. 2020 13:11)
https://online.flippingbook.com/view/36898/
Do you want be famous on tiktok? Click link above and enjoy fans and followers free! 2021 UPDATED!
tik tok hack 2021,tiktok likes 2021 free,tiktok fans 2021 free,tiktok free followers 2021,tiktok free usa hack 2021,tiktok free likes usa 2021,tiktok free followers 2021 usa,hearts free tiktok
KW:
Tik Tok Hack Followers 2019 2021
Freer Pro Tiktok Fans 2021
Tik Tok Free Followers No Human Verification 2021
How To Gain More Followers On Tiktok 2021
Source of article:
2. https://www.purchase.edu/live/events/21400-tik-tok-video-competition
Get Free Robux 2020 DECEMBER UPDATED
(MixClots, 23. 12. 2020 0:22)
https://graws-things.tumblr.com/
KW:
ROBLOX Cheats For Robux 2020 OCTOBER UPDATED
ROBLOX Free Gift Cards Generater 2021
ROBLOX Gift Cards Near Me 2021
ROBLOX Gift Cards Codes February 7 For 400 Rubux 2021
XRumer 19.0 + XEvil recognize of captchas Google, Facebook, Captcha.Com, SolveMedia, Bing
(Lola.tixonoffapn54, 22. 12. 2020 8:20)
Absolutně nová aktualizace balíčku SEO / SMM "XRumer 19.0 + XEvil 5.0":
captcha řešení Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
a více než 12000 dalších kategorií captcha,
s nejvyšší přesností (80 až 100%) a nejvyšší rychlostí (100 img za sekundu).
Můžete připojit XEvil 5.0 k nejoblíbenějšímu softwaru SEO / SMM: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke a více než 100 dalších softwarů.
Zájem? Existuje spousta nepřehledných videí o XEvile na YouTube.
Hodně štěstí!
XEvil Net
Forex trading software online
(Forexvoma, 21. 12. 2020 7:58)ფუნდამენტალური ანალიზის ფორექსის წიგნი. https://ge.forex-is.com
Forex robotics
(Forexvoma, 10. 12. 2020 22:12)Pobieranie wskaźnika Forex. https://pl.forex-is.com
រាំស្វា ភ្លេងសុទ្ធ
(cambodiamussuc, 10. 12. 2020 9:09)
តន់ ចន្ទសីម៉ា ភ្លេងសុទ្ធ
ខារា៉អូខេ ភ្លេងសុទ្ធ
កូនប្រសារស្រុកស្រែ
និពន្ធ Melody និងទំនុកច្រៀង សេង តារា
និពន្ធបទភ្លេង ទីណូ
សម្រួលឡើងវិញ សាក់
https://www.youtube.com/watch?v=vtChbT6QpCg
https://www.youtube.com/channel/UCcC55uu4uBpgxGkyUsozQ5A
How to disable pm?
(belleDriex, 9. 12. 2020 7:36)Hello i am new user and i would to ask you, How to disable a pm?
Always very favorable prices for servicesmassage happy ending in NY
(MatthewMiz, 7. 12. 2020 18:52)
<b></b>
Pnademic info expert
(MixClots, 3. 12. 2020 23:56)
I am expert of pandemic, and i can help you.
PS: How are you? I am from France :)/ mixx
Dating and sex without obligation in your city
(Gabrielevorm, 30. 11. 2020 4:34)
https://bit.ly/2I3ZL7m - Dating and sex without obligation in your city
https://t.me/DatingFlirting
- Flirting in your city
@@@==
Hi! Only from 18+!
(SandraRip, 24. 11. 2020 17:49)Here loveawake.ru you are waiting for interesting Dating only for adults!
finnar runt munnen magen aperca.se
(aperca.se, 6. 11. 2020 8:52)
Hi there! I know this is kinda off topic but I'd figured I'd ask. Would you be interested in exchanging links or maybe guest authoring a blog post or vice-versa? My site addresses a lot of the same subjects as yours and I believe we could greatly benefit from each other. If you happen to be interested feel free to shoot me an email. I look forward to hearing from you! Fantastic blog by the way! huera.aperca.se/map3.php finnar runt munnen magen
dehllap.se boeuf bourgogne recept
(dehllap.se boeuf bourgogne recept, 5. 11. 2020 17:36)
I could not resist commenting. Perfectly written! boeuf bourgogne recept dehllap.se/map9.php
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 | 51 | 52 | 53
eunicesildenafilcitrate.com
(buy sildenafil generic online, 7. 4. 2021 19:49)