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ářů
In it something is. Many thanks for the information, now I will not commit such error.
In my opinion you are not right. Write to me in PM, we will communicate.
(Darnellunsem, 10. 7. 2021 14:08)
In it something is. Thanks for the help in this question, I too consider, that the easier the better …
halv fregatebys passionnant vermehrten powstrzyma
(Henisprusy, 9. 7. 2021 22:45)https://gee.su/uhL35 https://gee.su/Y30lv https://gee.su/zhHct https://cutt.us/HfcVV - https://gee.su/Hoxdt https://qps.ru/qaZ0M https://clck.ru/VvVTU https://clck.ru/VvWvg https://qps.ru/73k5A https://gee.su/90lzV - https://gee.su/CvLZO https://qps.ru/EwWJx https://gee.su/IhTWg https://qps.ru/7wWEp https://qps.ru/8sOog https://gee.su/iTVgS - https://qps.ru/8gRpz https://clck.ru/VvrkQ https://qps.ru/ZErlg https://qps.ru/mtc6Mhttps://cutt.us/EAZTT https://gee.su/6rcqs https://qps.ru/TUWH6 https://clck.ru/VvhoN - https://qps.ru/AYHk9 https://gee.su/ApNVK https://gee.su/8HsFE https://clck.ru/VvQbX https://clck.ru/Vvbvq https://qps.ru/a8R2c - https://gee.su/pmrsN https://qps.ru/pmH8Y https://qps.ru/aIb7V https://clck.ru/VvTKv https://clck.ru/VvsWV https://gee.su/h9c4u - https://clck.ru/VvDjW https://qps.ru/3RhHx https://clck.ru/VvJ5F https://qps.ru/Adukb
tiduran bloku ingrained glubble uvedomit
(Henisprusy, 9. 7. 2021 13:35)https://gee.su/PmkLl https://qps.ru/eNdA7 https://gee.su/KyU5P https://clck.ru/VvgcY - https://qps.ru/qAiRe https://qps.ru/0C6QS https://qps.ru/nat3S https://cutt.us/ylOgk https://cutt.us/UxvNl https://gee.su/ctIU0 - https://clck.ru/VvU9V https://clck.ru/VxBHz https://cutt.us/cyquk https://clck.ru/Vvxrz https://clck.ru/VvV4j https://cutt.us/HIRno - https://cutt.us/kAckE https://gee.su/1LoQ2 https://qps.ru/k6YAy https://qps.ru/HowGOhttps://cutt.us/moyjq https://qps.ru/O9vCV https://cutt.us/bMdBO https://qps.ru/f9E8r - https://cutt.us/yAGof https://cutt.us/gYjcy https://gee.su/GJqk3 https://gee.su/DAT9Y https://qps.ru/6UBgI https://gee.su/C1QaP - https://clck.ru/VvGmV https://clck.ru/Vw5qh https://gee.su/ORBTC https://cutt.us/lDhlC https://cutt.us/FosIl https://gee.su/tDUa6 - https://cutt.us/ESazT https://qps.ru/JT5aA https://clck.ru/VvGqV https://qps.ru/j9tlH
Как отправить пользователю личное сообщение?
(Lerraleddy, 9. 7. 2021 9:44)
Привет! Подскажите, пожалуйста, глупой Lerussik, как тут отправить личное сообщение? Очень надо! Спасибо
Hi! Can you please tell stupid Lerussik how to send a private message Thanks
prestasi amener picturedin bersekolah digitalnych
(Henisprusy, 9. 7. 2021 4:43)https://clck.ru/VvqMg https://qps.ru/xSm4g https://gee.su/wKsnv https://cutt.us/kyukO - https://clck.ru/VvM8D https://cutt.us/xRYsl https://cutt.us/EYmaN https://qps.ru/7coy5 https://cutt.us/MkBlG https://cutt.us/kFemp - https://cutt.us/rIhiD https://cutt.us/rbzVk https://qps.ru/40pWK https://clck.ru/VvtNp https://qps.ru/Hxi4b https://gee.su/Q3hey - https://clck.ru/VwKpc https://gee.su/ZmJT6 https://qps.ru/1cyBv https://clck.ru/VvaHfhttps://cutt.us/iDgvG https://qps.ru/Kbud4 https://gee.su/8hPmp https://cutt.us/LcmeT - https://qps.ru/PV7yR https://gee.su/4l6oZ https://cutt.us/ckHrn https://cutt.us/HIoIo https://clck.ru/VwV84 https://gee.su/p7L40 - https://clck.ru/VvjvR https://qps.ru/BA9Qd https://qps.ru/1r0Ql https://cutt.us/RNzqU https://qps.ru/RMYmz https://qps.ru/xyPgf - https://clck.ru/VwUed https://qps.ru/sCjPb https://clck.ru/VwRUN https://qps.ru/yfdtv
underages dupes andersens nagoya patronage
(Henisprusy, 8. 7. 2021 19:52)https://clck.ru/VvV8H https://gee.su/pMWV3 https://cutt.us/xbHId https://clck.ru/VvoVx - https://qps.ru/lSXIu https://gee.su/kFQHg https://cutt.us/WimhU https://gee.su/D0Ie3 https://cutt.us/VIsHa https://clck.ru/Vw5dw - https://cutt.us/lfwDo https://gee.su/tnXOa https://gee.su/4zVqn https://qps.ru/tWlRo https://clck.ru/VvNVh https://clck.ru/VwCu4 - https://clck.ru/VvXAK https://qps.ru/GVtaH https://cutt.us/Ygzqb https://qps.ru/BKeuChttps://cutt.us/kUhSs https://cutt.us/Syztp https://gee.su/y00lC https://clck.ru/VwpyQ - https://qps.ru/MAqOX https://qps.ru/CwtXM https://clck.ru/VwD9Z https://gee.su/CcNaS https://clck.ru/Vvajs https://clck.ru/VvRWo - https://clck.ru/VvPdJ https://clck.ru/VvT4m https://qps.ru/GTVlZ https://qps.ru/GHaum https://cutt.us/JjonI https://clck.ru/VvaJA - https://gee.su/GdpYu https://cutt.us/kfSyH https://clck.ru/VwaW7 https://cutt.us/WbIyH
The Best Offer of The Year!
(CoreyPed, 8. 7. 2021 19:44)
This year turned out to be very difficult. But we have optimized and reduced the cost of our products!
It is almost impossible to find prices lower than ours, the sale is at the cost price level.
Watch and be surprised by our super low prices https://is.gd/72jG3I
Hot Celebs sites!?
(Hot Celebs vex, 8. 7. 2021 19:08)Best celebs sex vieos https://www.fuckcelebs.net/search.php?q=nude-scene
does cbd oil go bad
(RobertInack, 8. 7. 2021 14:28)Most skunks have a variegated fur pattern of spots or stripes. A blond skunk is a light-colored skunk that still has visible patterns in its fur. Some portions of the fur are creamy white and other portions are bright white. A skunk will very rarely have fur that is white with a slight purplish hue. This is a lavender skunk. https://chopot.org/cbd-for-essential-tremors/ White Rhino Marijuana Strain Review + Guide. Charlotte’s Web™ CBD gummies feature our whole-plant hemp extract and nutraceutical blends to support you, day and night. These plant-powered CBD gummies are flavored with natural juices, delivering botanical goodness you can taste. https://chopot.org/cbd-american-shaman-get-you-high/ Pictures speak louder than words! Upload your "Malibu Marsha" Photos here and help other growers to get a better impression of this variety. What does Pink Candy taste like? White Rhino is another one of those strains with a mysterious parentage; though we do know that White Widow is its direct ancestor, we have no idea what other strain was used to create this potent indica. Even in this modern age of enormous attention to detail, there are still some strains that slip through the cracks. https://chopot.org/cbd-oil-and-lexapro/
mohammad overbroadfga alakit exclamation raububerfall
(Henisprusy, 8. 7. 2021 10:40)https://clck.ru/VvZTJ https://gee.su/eFWx7 https://clck.ru/VvZfN https://qps.ru/OJUs0 - https://qps.ru/KXUT0 https://qps.ru/yHQTf https://qps.ru/J58sG https://qps.ru/zaoSB https://clck.ru/VvKPA https://qps.ru/yxDOH - https://gee.su/izvRP https://gee.su/S5RuA https://gee.su/70sDm https://gee.su/wclHp https://clck.ru/VvWcN https://qps.ru/Hvgyb - https://gee.su/TRwUu https://qps.ru/2urJa https://gee.su/rc0eV https://clck.ru/VwtYhhttps://clck.ru/Vw2AH https://cutt.us/AIgbV https://clck.ru/VwfUJ https://qps.ru/Y0teV - https://gee.su/v7VTH https://clck.ru/VvdH2 https://gee.su/BKnMI https://clck.ru/VvXRg https://clck.ru/VvcjM https://clck.ru/VvVd6 - https://cutt.us/yxFpY https://qps.ru/K3CUo https://cutt.us/aHZzp https://clck.ru/VvjZ2 https://cutt.us/MsmkX https://gee.su/6x5wY - https://gee.su/eCtrs https://cutt.us/PiNBI https://qps.ru/yAp5d https://gee.su/v4bIq
Write me in a dating site!
(LolaFople, 8. 7. 2021 2:30)
<img src="https://i.imgur.com/ciPA9pa.png">
Hey. I like you.Write me in a dating site!
This is a link to my profile: https://datingforkings.club/
Kiss you
valgono sheerest polsko sancionado ribelli
(Henisprusy, 8. 7. 2021 1:39)https://clck.ru/VvSgY https://clck.ru/Vvn7K https://clck.ru/VwySW https://clck.ru/VvTsn - https://clck.ru/VvrYN https://gee.su/f4VYI https://clck.ru/VvaS8 https://clck.ru/VvbBY https://cutt.us/BCAbo https://gee.su/FTRJk - https://qps.ru/M2UDp https://gee.su/kY5gv https://gee.su/j9nWH https://qps.ru/15RT9 https://gee.su/qP6YR https://qps.ru/dr1sl - https://qps.ru/A2EGN https://cutt.us/HhTnM https://qps.ru/K67FI https://cutt.us/ZKtxxhttps://clck.ru/VvFSB https://cutt.us/RmRVP https://qps.ru/ejAFQ https://clck.ru/VvU8Y - https://clck.ru/Vwu6e https://clck.ru/VvDeb https://clck.ru/VvQtk https://clck.ru/VvJzL https://gee.su/85myJ https://gee.su/wjzYm - https://qps.ru/nGNMA https://clck.ru/VwFjh https://cutt.us/eWLwK https://cutt.us/ApMeu https://cutt.us/NAItu https://qps.ru/hTWsL - https://gee.su/MpKeZ https://qps.ru/czRIr https://clck.ru/VvkuV https://qps.ru/kzV5Y
Major
(KennethGef, 5. 7. 2021 12:42)
This is a unique place for fashionable women's clothing and accessories.
We offer our clients women's clothing, jewelry, cosmetics and health products, shoes, bags and much more.
https://fas.st/Ujfha
Women's Manufacture Backpack
(JasonDup, 5. 7. 2021 1:35)https://geni.us/qX4pKE natural leather knapsack for ladies
Top games
(ScottNeefs, 2. 7. 2021 22:49)
Play for free on cool site https://www.myadultonlinegames.com/category/premium-adult-games in adult games
peableletapique jujna
(pharmaceptica, 1. 7. 2021 8:44)tadalafil troche https://pharmaceptica.com/
Внимание скидки Замочи сайт мошенника спамные базы
(PetrWlasow, 30. 6. 2021 23:33)
Приветствуем вас!
Делаем отличное предложение: лучшие прогоны, чтобы "утопить" веб-сайт вашего конкурента. Всего от 2 000 р.
- Стопроцентный результат. Интернет-сайты ваших конкурентов "умрут".
- Максимально возможное количество негативных фитбеков.
- Собрана особая база - самые "убийственные" площадки из 10 000 000 ресурсов (вирусных, спамных, порно и так далее). Работает безотказно.
- Прогон проводится сразу с четырех серверов.
- Постоянный спам вирусных ссылок на электронную почту.
- Выполнение на протяжении 40-240 часов день и ночь. Растянем как угодно по времени.
- Прогон с запретными ключами.
- При 2-ух заказах - отличные скидки.
Цена $70
Полная отчётность.
Оплата: Qiwi, Яндекс.Деньги, Bitcoin, Visa, MasterCard...
Telgrm: @xrumers
Skype: xrumer.pro
WhatsApp: +7(977)536-08-36
маил: support@xrumer.cc
Только эти!
А тАкож Работаем со Студиями!
Quality products and drugs only here https://bit.ly/3wlPWWx
(Fum, 30. 6. 2021 3:51)
Quality medical products at a low cost. Worldwide delivery
https://bit.ly/3wlPWWx
How To Get Free Coins On NUTAKU JULY 2021
(belleDriex, 29. 6. 2021 4:11)
https://paiza.io/projects/sQHWfBawM1Ka4PsTAbrEog
Nutaku is an adult gaming platform with primarily hentai games. Located in Canada, Nutaku offers games with mature content. The platform focuses on browser, downloadable and mobile games,<>] offering microtransactions and purchasable options. As of early 2020, Nutaku had 50 million registered users.<>] Nutaku offers a large pool of 450+<>] free-to-play and paid titles of various genres, including action-adventure, massively multiplayer online game, real-time strategy, tower defense, dating sim, clicker, collectible card game, puzzle, turn-based strategy (TBS), strategy, visual novels, kinetic novels, and virtual reality.
NUTAKU Gold Coin Hack No Survey JULY 2021
NUTAKU Gold Glitch
How To Get Gold On NUTAKU
How To Get Free Goldl NUTAKU JULY 2021
NUTAKU Free Redeem Codes
NUTAKU Gold Cheat 2022
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 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97
I recommend to you to visit a site, with an information large quantity on a theme interesting you.
(CarlosKaw, 10. 7. 2021 14:09)