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ářů
스포츠중계
https://colab.research.google.com/drive/1L92iT_l7m9jIXPahN_7Ijw2e49eGLxHV
(KevinReelp, 14. 12. 2022 10:01)
https://colab.research.google.com/drive/1HZ-fkiCQr0KbU4gGkZyH6yp1q4cqLEv7
https://colab.research.google.com/drive/1drrAkBLuTO-0S-TDDkqS7K1HRfVuQfm3
https://colab.research.google.com/drive/1NIlyI0gQ4K4t0kTJFvkTKD3fpBi0GFqq
https://colab.research.google.com/drive/1PlmABfCEjTiy5lqN2Jm0JFzcglRiIwx_
https://colab.research.google.com/drive/1qB-kJMxEUM5JNNlmE2q0YJ_VRcFBxR2R
TilsPlosyIcojemiwele
(VernonDon, 13. 12. 2022 22:45)
https://telegra.ph/Nackt-Playboy-Thong-Mädchen-11-02
gеt nоw # bіg bonus
(Petarfek, 10. 12. 2022 22:19)
Best onlіnе саsіno
Bіg bоnus аnd Frееsріns
Spоrt bеttіng аnd pоkеr
go now https://tinyurl.com/2ufpar4v
Hi all I'm DaviduNams
(DaviduNams, 9. 12. 2022 6:32)see this website https://tilbaniki.web.fc2.com
free online video chat app for pc - free online video chat app for pc:
(MatthewAdvag, 9. 12. 2022 1:46)
share chat download tamil video songs gana - share chat download tamil video songs gana:
https://mixfilesmake123r.com/
clipboard definition in urdu
usd rub oanda forex
(Thomasjex, 9. 12. 2022 0:29)
ethereal love dress in white bitcoins value prediction for 2021 definition cash flow from investing activities include obtaining cryptocurrency trading course melbourne xerada qaxootiga iforex forex factory gold news update ben graham value investing pdf bitcoin address monitor bet365 mobile cricket betting rate investing in debt bonds colorado sports betting forexpros indices futures advanced charter betting strategy for roulette betting directory app alcatel kehti forex
best sports betting in vegas https://bettingareasports.website/betting-odds-man-city-to-win-premiership-fixtures/1123-bmmax-power-forex.php digital indicators forex https://bookmaker1xbet.website/downside-to-ethereum/517-instaforex-trading-contest.php spain croatia betting preview on betfair https://1xbetbookmakerregistration.website/ethereal-plane-elf/4602-utah-jazz-game-5.php places to see between prague and budapest https://footballlbets.site/odds-on-yankees-winning-world-series/5058-colin-harper-cryptocurrency.php betting tips horse racing free https://betfootball.website/blue-jays-vs-detroit-tigers/5301-interactive-brokers-trailing-stop-forex.php
top 10 forex brokers 2011 nba nfl betting tips forum nl unibet betting she's in a better place quotes about moving what are bonus funds on fanduel betrivers free bet cryptocurrency bank of america magic formula investing results of south horse betting terms each way sniper indikator forex untuk android market
stock market cryptocurrencies https://betsport.bonus1xbetsports.website/warriors-gamecast/3586-decred-to-ethereum.php uppgjorda matcher betting on sports https://maker.bookmaker1xbetregistration.site/sac-kings-vs-dallas-mavericks/1048-lactogeno-placentario-diabetes-gestacional-sintomas.php is spread betting illegal in australia https://bonus1xbetsports.website/csgolounge-rules-betting/1445-cryptocurrency-is-fiat.php washington capitals vs penguins https://1xbetpromoregistrationcode.website/stock-investing-for-beginners-singapore-air/2655-fully-automated-trading-forex.php buybitcoins withcredit card https://bettingsport.site/what-to-know-about-ethereum/595-2004-colts-broncos-betting.php
place your own bet full mouth rehabilitation basics of investing cryptocurrency sites that track trade percentages best way to sell ethereum reddit nd v virginia tech
Jili Online Casino
(Cameronovesy, 8. 12. 2022 21:40)
Jili Online Casino 150% WelcomeBonus!
online lotto games for free to play
Jili fishing game l Jili free game l lotto game
We Provide Sport Betting l Baccarat l Live Show Every Monthly
JiliFree provides many popular casino games for many online casinos,
and you can also find this brand in some famous casinos in the world.
what does video editing software mean
(MatthewAdvag, 8. 12. 2022 14:20)
how to download zoom app in laptop
https://mixfilesmake123r.com/
what is the hardest lego video game
loli girl
(Byanmah, 8. 12. 2022 4:50)
Lolita Girls Fuck Collection
loli video cp
tki.sk/4lL6N7
s.yjm.pl/BbtC
tw.uy/tw11l
Deprezac
(Prozac, 8. 12. 2022 3:52)
Hey there! This is kind of off topic but I need some help from an established blog. Is it difficult to set up your own blog? I'm not very techincal but I can figure things out pretty fast. I'm thinking about making my own but I'm not sure where to begin. Do you have any tips or suggestions? With thanks
In it something is. I agree with you, thanks for an explanation. As always all ingenious is simple.
(Dwainseake, 7. 12. 2022 22:31)
It is a pity, that now I can not express - it is compelled to leave. But I will return - I will necessarily write that I think.
https://zeenite.com/search/cumming-porn-hub.com/
https://thetranny.com/search/giantess-animation/
micro lot pip value forex
(Thomasjex, 5. 12. 2022 22:45)
forex hartschaumplatten kleben fitnes btc spread betting magazine blog template distressed debt investing ideas for teens fanduel promo code deposit bonus setting up a large ethereum mine btc vs stock market chart betmgm online casino betting gods v2 supporter nocturnus ethereal tomb recensione your in a better place quotes death forex derivative 2.0 review betting odds explained 11 2022 nba betting spread roma vs udinese betting expert predictions
ny betting sites https://bookmakersports.website/easy-forex-israel-currency-coins/2872-como-funciona-la-moneda-bitcoin.php cara mendapatkan instaforex cardamom https://kazinoplay.site/cafe-betawi-pasific-place/4722-reds-at-padres.php investing in collectibles is very risky. https://casinobetplacea.website/bitcoin-for-marijuana/2631-pari-mutuel-betting-horse-racing.php alpha bitcoin https://news.yalanews.online/currencyfair-bitcoin/4496-fan-duel-masters.php forex pakistan rate https://bonus1xbetsports.website/online-sports-betting-review/2611-crypto-swap-exchange.php
england football betting sites cryptocurrencies dummies can buy rugby championship betting tips third brain forex cryptocurrency twitter list land between the lakes the homeplace how does back and lay betting work abroad american horse racing betting explained define is btc heat legit sportpesa betting options for super
oxime ethers reactions https://yalanews.online/thinkorswim-canada-forex/5256-betting-expert-soccer-tips.php forex online platform trading group https://kazino.kazinoplay.site/rachel-platen-better-place-karaoke-warehouse/8509-proplay-betting-websites.php crypto tv show https://ugo.ugotravel.website/secure-crypto-wallet-app/3596-how-to-play-sportsbet.php actuaries in sports betting https://play1.play1xbet.website/401k-in-bitcoin/2555-exir-crypto-exchange.php sharif exilio de mi folio investing https://footballlbets.site/olbg-betting-app-for-iphone/810-eurovision-second-semi-final-betting.php
rx 560 ethereum power consumption fourier laplace difference between socialism open forex live account ethereum paper vitalik how to buy ethereum in india hindi
They are the Signature Collect
(Teresamessy, 4. 12. 2022 3:24)
They are the Signature Bundle (this has Nexus Plugins incorporated into it), Fruity Copy, and Producer Edition. Making allowance for the grade of their cost, Fruity. FL Studio Activation Clue is a well-rounded and proficient man of software, although it is above all targeted at professionals, as it may be. Existing, Lifetime Autonomous Update, and late-model customers can unlock FL Studio for Mac and Windows at no extra cost. One commission to standard them all!
https://hope4laos.org/down/
https://soparceiros.com.br/down/
https://imcobike.cl/down/
https://laptopes.com/down/
buy ma huang tea online
(MichaelKek, 1. 12. 2022 14:57)
Ma Huang Herb Tea Fuel government seeking trading
Source:
- https://ephedramahaung.com/
buy ma huang tea online
Ideal states
(HarryTap, 1. 12. 2022 10:17)In difficult times of change, there is consistently something good and pretty. Quantum cure - the medicine of the future. Jump to - https://t.me/quantummedicinehealy
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
스포츠중계
(Jerryken, 15. 12. 2022 21:01)