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://telegra.ph/Roulette-lyrics-01-08#Roulette lyrics
https://telegra.ph/Live-roulette-malaysia-01-08#Live roulette malaysia
https://telegra.ph/Live-roulette-sky-bet-01-08#Live roulette sky bet
https://telegra.ph/Live-poker-reporting-01-08#Live poker reporting
https://telegra.ph/Algoritmos-para-ganar-en-casinos-online-01-08#Algoritmos para ganar en casinos online
What are the main differences between living in California and Oregon?
(Michaelshete, 25. 1. 2023 12:21)
Switching from California to Oregon can be quite a change, as there are some major differences between the two states. California is known for its warm climate and bustling cities, while Oregon is known for its lush green forests and milder weather. Additionally, California is a much more densely populated state, while Oregon is more rural and sparsely populated. https://trentonbxsmh.pages10.com/The-Fact-About-moving-from-California-to-Oregon-That-No-One-Is-Suggesting-50225562 -
Shifting from California to Oregon
MOM TAKES A IN COITION PORN
(TimothyTycle, 22. 1. 2023 0:37)
Jean, his ma's younger sister, arrived at the legislative body fulgorous and early on Saturday morning.
"Hi squirt," she said. Rick didn't jealous of the slate it was a nickname she had specified him when he was born. At the time, she was six and thought the name was cute. They had unendingly been closer than most nephews and aunts, with a standard diminutive girl thought process she felt it was her responsibility to nick take worry of him. "Hi Jean," his mammy and he said in unison. "What's up?" his care for added.
"Don't you two muse on, you promised to remedy me take some stuff out to the сторидж discharge at Mom and Dad's farm. Didn't you attired in b be committed to some too Terri?"
"Oh, I quite forgot, but it doesn't occasion to save it's all separated in the aid bedroom." She turned to her son. "Can you usurp Rick?"
"Yeah," He said. "I've got nothing planned for the day. Tod's discernible of hamlet and Jeff is laid up in bed, so there's no rhyme to hover discernible with."
As muscular as Rick was, it was smooth a myriad of opus to weight the bed, case and boxes from his aunts line and from his own into the pickup. Finally after two hours they were ready to go. Rick covered the stuff, because it looked like rain and measured had to move a couple of the boxes centre the goods background it on the bum next to Jean.
"You're effective to suffer with to remain on Rick's lap," Jean said to Terri, "There won't be enough office otherwise."
"That drive be alright, won't it Rick?" his nurturer said.
"Fit as prolonged as you don't weigh a ton, and take up the whole side of the truck," he said laughing.
"I'll have you know I weigh one hundred and five pounds, boyish bloke, and I'm one five foot three, not six foot three." She was grinning when she said it, but there was a bantam segment of smugness in her voice. At thirty-six, his nourisher had the body and looks of a capital school senior. Although infrequent extravagant circle girls had 36C boobs that were full, undeviating and had such first nipples, together with a number ten ass. Business his notice to her body was not the a- crap she could have done.
He settled himself in the tokus and she climbed in and, placing her feet between his, she lowered herself to his lap. She was wearing a thin summer clothe and he had seen solitary a bikini panty pursuit and bra under it. He instanter felt the ardour from her main part gush into his crotch area. He turned his capacity to the road ahead. Jean pulled away, and moments later they were on the fatherland approach to the lease, twenty miles away.
https://twinkporn.one/videos/9920/four-eyed-boy-michael-milks-his-hard-meat-and-rubs-his-ass/
What are the main differences between living in California and Oregon?
(Michaelshete, 21. 1. 2023 14:29)
Relocating from California to Oregon can be quite a change, as there are some major differences between the two states. California is known for its warm climate and bustling cities, while Oregon is known for its lush green forests and milder weather. Additionally, California is a much more densely populated state, while Oregon is more rural and sparsely populated. https://trentonbxsmh.pages10.com/The-Fact-About-moving-from-California-to-Oregon-That-No-One-Is-Suggesting-50225562 -
Shifting from California to Oregon
zaa1688.com อยากถูกหวย ต้องเว็บนี้เท่านั้น
(ZAAansip, 20. 1. 2023 19:59)zaa1688.com อยากถูกหวย ต้องเว็บนี้เท่านั้น https://zaa1688.com - https://zaa1688.com
Správný přístup při čtení sexuálních příběhů, mýtus nebo realita?
(Dinasek, 19. 1. 2023 7:33)
Dobrý den!
Nedávno jsem narazila na stránky soukromých sexuálních povídek, nikdy předtím jsem něco podobného nečetla a byla to velmi zajímavá zkušenost!
Je to čtení erotických myšlenek a myšlenek jiných lidí, jejich skutečné nebo vymyšlené sexuální příběhy, které vzrušují několikanásobně více,
nutí pracovat s představivostí a představovat si obrazy ze spisy.
Web, který jsem našla – https://www.sexsrasskazy.ru
Za zmínku stojí, žádné reklamy, špína a porno obrázky, jen text a vaše představivost, to je opravdu úžasné!
Abych byl upřímný, neustálé vzrušení mi dodalo barvu do života, s partnerem jsme začali častěji mít sex a experimentovat.
Doporučuji web výše a přeji vám dobré čtení!
https://telegra.ph/Fresh-casino-201-12-17#Fresh casino 201
(Dennisbot, 16. 1. 2023 8:40)
https://telegra.ph/Igrovye-avtomaty-v-yakutske-12-17#Ргровые автоматы РІ якутске
https://telegra.ph/Filmy-s-ogrableniyami-kazino-12-18#Фильмы с ограблениями казино
https://telegra.ph/Besplatnye-igrovye-avtomaty-igrat-admiral-12-17#Бесплатные игровые автоматы играть адмирал
https://telegra.ph/Igrovye-avtomaty-90-h-poker-12-18#Ргровые автоматы 90 С… покер
https://telegra.ph/Igra-banki-igrovye-avtomaty-12-18#РРіСЂР° банки игровые автоматы
https://telegra.ph/Igrovye-avtomaty-slot-igrat-besplatno-onlajn-vse-igry-igrat-12-17#Ргровые автоматы слот играть бесплатно онлайн РІСЃРµ РёРіСЂС‹ играть
https://telegra.ph/Vulkan-avtomaty-bezdepozitnyj-bonus-12-17#Вулкан автоматы бездепозитный бонус
https://telegra.ph/Igrovoj-avtomat-super-dzhamp-igrat-i-12-17#РРіСЂРѕРІРѕР№ автомат супер джамп играть i
https://telegra.ph/Igrovye-avtomaty-fresh-12-17#Ргровые автоматы фреш
https://telegra.ph/Sozdadim-i-kazino-12-18#Создадим i казино
https://telegra.ph/Kazino-royal-film-agent-007-12-17#Казино рояль фильм агент 007
https://telegra.ph/Besplatno-igrat-v-igrovye-avtomaty-bez-registracii-i-sms-admiral-12-17#Бесплатно играть в игровые автоматы без регистрации и смс адмирал
https://telegra.ph/Igrovye-avtomaty-stavka-ot-50-rublej-12-17#Ргровые автоматы ставка РѕС‚ 50 рублей
https://telegra.ph/Igrovoj-avtomaty-onlajn-besplatno-igrat-bez-registracii-777-12-17#РРіСЂРѕРІРѕР№ автоматы онлайн бесплатно играть без регистрации 777
https://telegra.ph/Simulyator-igrovyh-avtomatov-igra-besplatno-12-18#Симулятор игровых автоматов игра бесплатно
https://telegra.ph/Demo-sloty-pragmatik-12-17#Демо слоты прагматик
https://telegra.ph/Onlajna-kazino-12-17#Онлайна казино
https://telegra.ph/Igrovye-amerikanskie-avtomaty-igrat-besplatno-onlajn-12-17#Ргровые американские автоматы играть бесплатно онлайн
https://telegra.ph/Kazino-ruletku-12-18#Казино рулетку
https://telegra.ph/Posmotret-vse-igrovye-avtomaty-igrat-12-18#Посмотреть все игровые автоматы играть
https://telegra.ph/Poker-dom-sloty-kakie-12-17#Покер дом слоты какие
https://telegra.ph/Igrat-v-2000-goda-igrovye-avtomaty-besplatno-bez-registracii-12-17#Рграть РІ 2000 РіРѕРґР° игровые автоматы бесплатно без регистрации
https://telegra.ph/Igrat-v-demo-azartnye-igry-besplatno-bez-registracii-na-igrovyh-avtomatah-12-18#Рграть РІ демо азартные РёРіСЂС‹ бесплатно без регистрации РЅР° игровых автоматах
https://telegra.ph/Igrovaya-zona-vladivostok-foto-12-17#Ргровая Р·РѕРЅР° владивосток фото
https://telegra.ph/Vulkan-akcii-12-17#Вулкан акции
zaaheng.com เว็บหวย เปิดใหม่ จ่ายเยอะ
(Briansip, 15. 1. 2023 22:52)zaaheng.com เว็บหวย เปิดใหม่ จ่ายเยอะ https://zaaheng.com - https://zaaheng.com
https://telegra.ph/Cassinos-em-brasil-01-08#Cassinos em brasil
(Geraldstarm, 15. 1. 2023 1:12)
https://telegra.ph/Casinos-online-brasil-01-08#Casinos online brasil
https://telegra.ph/Best-time-to-play-live-poker-01-08#Best time to play live poker
https://telegra.ph/Live-poker-coverage-01-08#Live poker coverage
https://telegra.ph/Betfair-live-roulette-01-08#Betfair live roulette
https://telegra.ph/Real-live-poker-online-01-08#Real live poker online
what is the passto?
(Charlessem, 14. 1. 2023 23:37)PassTo, making currency transactions easy, is committed to becoming the currency exchange benchmark in the financial industry. By creating a platform of "real-time quotations, convenient solutions, and the most complete MSO", it will be more convenient for everyone to exchange currency. During your currency transactions, PassTo will never be absent. home page: <u>https://www.passto.io/</u>
TilsPlosyIcojemiwele
(VernonDon, 12. 1. 2023 16:44)
https://vk.com/@-190536737-hardcore-naked-metal-girls
XXX site listing
(Tyronecem, 12. 1. 2023 8:02)
Source:
- https://fucktubeporn.xyz
tube porn
best womens gifts for christmas
(GeraldLeami, 11. 1. 2023 3:35)best womens gifts for xmases https://amzn.to/3BEmtev
best womens gifts for christmas
(GeraldLeami, 10. 1. 2023 22:37)best females presents for christmas https://amzn.to/3BEmtev
what is the passto?
(Charlessem, 10. 1. 2023 16:43)PassTo, making currency transactions easy, is committed to becoming the currency exchange benchmark in the financial industry. By creating a platform of "real-time quotations, convenient solutions, and the most complete MSO", it will be more convenient for everyone to exchange currency. During your currency transactions, PassTo will never be absent. home page: <u>https://www.passto.io/</u>
video cp
(RihardKaf, 7. 1. 2023 1:32)
Lolita Girls Fuck Collection
loli video cp
yal.su/jCs
s.yjm.pl/BbtC
tw.uy/tw11l
This is my new video What do you think?
(Alexevacy, 6. 1. 2023 4:43)
Look my new video at Youtube https://www.youtube.com/watch?v=ePnGcs-M-4w
ice hack torches 13 lbs each week Plac\e ic\\e below to go down 2 lbs over night Ice + THIS = 2 pounds lighter by tomorrow
(JohnnyTwIva, 6. 1. 2023 0:44)
10-Second Metabolic Process Rate Examination.
10-Sec At Home Examination for Slow Metabolic Rate.
Inspect Your Metabolic Rate With This 10-Sec Test.
https://healthyfit.yivesites.com/that-instantly-turbo-charges-your-metabolism-by-450-or-more
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
https://telegra.ph/Philly-live-poker-01-08#Philly live poker
(DannyOdors, 26. 1. 2023 14:24)