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ářů
You are without a doubt fed up of functioning so hard for the small benefit you get. You want you can have your liberty back and do what you desire to do when you wish to do it.
However what can take place if you do not make the choice to change? You won't have the ability to up your life. Your desires will certainly never ever come true.
The time is now for you to have control of your own economic potential. Own your very own life and also quit existing like a servant to the system with our free of charge manual. Start right away and also learn exactly how easy it might be to enjoy the life that you are entitled to.
Check it out, it's totally cost-free >>> https://4dct.short.gy/limited.financial_guide_ <<<
I join. And I have faced it. We can communicate on this theme. Here or in PM.
(Tommykar, 5. 7. 2022 8:38)
Have quickly thought))))
https://youbangs.com
https://gayweddingsdj.com
I am assured, that you have misled.
(Tommykar, 4. 7. 2022 8:22)
I consider, that you are mistaken. I can prove it. Write to me in PM, we will communicate.
https://famexxx.com
https://calgarywasabi.com
In it something is. I will know, many thanks for an explanation.
(Tommykar, 4. 7. 2022 8:21)
In it something is. Earlier I thought differently, many thanks for the help in this question.
https://hyper-hk.com
https://ambergardens.net
tanie noclegi w augustowie nad jeziorem
(Sreglurdeft, 2. 7. 2022 11:36)
noclegi w Augustowie https://www.noclegiwaugustowie.pl
suntago noclegi w okolicy https://www.noclegiwaugustowie.pl/podlaskie-noclegi-janowo
Hi! I have a small question?
(Maxie, 1. 7. 2022 10:16)►►► ✅ Where can I get my gift? Here? https://lnk.do/oRLXPN
ethereum
(Chrisbiz, 29. 6. 2022 21:46)
Оnline cryptocurrency exchange service. The best rate, low fees, lack of verification.
We are trying to find brand-new employee [ENTERPRISE DEAL]
(NathanGok, 28. 6. 2022 5:57)
My organization is expanding so we remain in the demand for even more remote workers.
What you will certainly be doing: As a live chat aide you will certainly be paid to respond to live chat messages on a business's web site or social networks accounts.
This includes:
- answering client questions,
- giving sales links,
- and also supplying price cuts.
Full training is supplied so you do not need any kind of previous associated experience. Agreement length: No set duration
Price: $0.50 for every min ($ 30 per hour).
Skills/background needed:.
- Should have a device able to accessibility social networks as well as site conversation functions (Phone/Tablet/Laptop).
- Have the ability to work individually.
- Capacity to closely follow provided actions as well as guidelines.
Reputable net connection.
Hrs per : Flexible.
Area: Remote job online (favored).
For even more details: https://4dct.short.gy/massive.social_jobs
Have a great day,
Nathan Muller
PIANO SCORE Ravel Menuet Antique
(Herbertbaf, 23. 6. 2022 0:26)
https://replit.com/@BooksLibs/Download-285-Color-Paintings-of-Jean-Auguste-Dominique-Ingre
https://replit.com/@BooksLibs/Download-Fashion-workbook-Men-templates-Epub
https://replit.com/@BooksLibs/Download-Beethovens-Letters-1790-1826-Epub
https://replit.com/@BooksLib/Download-Ming-Su-A-Daughters-Journey-Epub
https://replit.com/@BooksLibs/Download-Atsuko-Goto-1st-photo-book-Fitness-Photo-Album-ph
https://replit.com/@BooksLibs/Download-MODELING-AND-MENTAL-HEALTH-How-to-be-happy-and-succ
https://replit.com/@BooksLib/Download-The-sweet-refreshment-gladly-shares-3-Epub
https://replit.com/@BooksLibs/Download-Funny-and-Interesting-Things-About-Shark-Cute-Imag
https://replit.com/@BooksLibs/Download-288-Color-Paintings-of-Henri-Fantin-Latour-French
https://replit.com/@BooksLib/Download-The-Great-Wall-Of-China-Hoax-Exploring-The-History
https://replit.com/@BooksLibs/Download-THE-RISE-AND-FALL-OF-THE-GREAT-INCA-EMPIRE-An-Acco
https://replit.com/@BooksLibs/Download-Ave-Maria-I-Franz-Schubert-I-6-Versions-Sheet-Mus
https://replit.com/@BooksLibs/Download-Sight-word-Epub
https://replit.com/@BooksLibs/Download-CRYPTO-TRADING-MADE-SIMPLE-2022-As-simple-as-ABC
https://replit.com/@BooksLib/Download-Only-with-a-rose-to-seal-5-Epub
https://techplanet.today/post/ichika-3dcg-character-vol-1-illustrations
https://rextester.com/EHN78887
https://articlepedia.xyz/paintings-feelings-comics-francisco-capilla/
https://pasteio.com/x58OnUNf1fBk
https://rextester.com/KYCSZ81161
canvas tent
(DavidNob, 21. 6. 2022 2:26)
40Celsius canvas tent are made from high quality waterproof cotton fabric. They are fast to install in 15 minutes and last for very long time. Free Shipping
UICELL
(DavidNob, 19. 6. 2022 8:27)
UICELL Conference Proceeding is published by University of Muhammadiyah Prof. DR. HAMKA (UHAMKA). p-ISSN: 2615-4269; e-ISSN: 2615-2576. It includes all papers presented at UICELL Conference. The articles in this electronic proceeding may have different format from the print versions. Each of the article is subject to minor spelling and grammatical error. Article copyright (c) rests on the authors
aesthetic
(EdwardTRURO, 18. 6. 2022 15:19)
Are you in.
https://stboger9.com/
Aphorisms often use metaphors or creative imagery to express ideas.
Because let’s face it, perseverance is the key to success in life.
It’s become one of the most viral memes on the internet.
Washington also said, It is better to offer no excuse than a bad one.
One of his most notable is, An ounce of prevention is worth a pound of cure.
Now you might be asking.
Pick an aphorism that relates to your message and use it to stay focused on your overarching theme.
Let’s get started.
It’s a great saying, but it’s not something you’d necessarily repeat over the dinner table.
Examples of Aphorisms for Success
Remember that.
Sandys said, Honestie the best policie, which in modern English is…
Want a few more.
Not so much.
Aphoristic statements also appear in everyday life, such as daily speeches made by politicians and leaders.
UICELL
(DavidNob, 17. 6. 2022 14:17)
UICELL Conference Proceeding is published by University of Muhammadiyah Prof. DR. HAMKA (UHAMKA). p-ISSN: 2615-4269; e-ISSN: 2615-2576. It includes all papers presented at UICELL Conference. The articles in this electronic proceeding may have different format from the print versions. Each of the article is subject to minor spelling and grammatical error. Article copyright (c) rests on the authors
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
Free business training program
(DavidHut, 9. 7. 2022 3:47)