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ářů
Are you looking for a way to make money through reselling, NFTs, or ticket sales? Are you constantly searching for pricing errors that can help you score big profits? Look no further than our group dedicated to helping you succeed in these endeavors!
Our group is made up of experienced resellers, NFT collectors, and ticket brokers who are passionate about finding the best deals and maximizing profits. We use our expertise and knowledge of the industry to help members of our group find great deals and identify pricing errors that can lead to huge profits.
Whether you're new to reselling, interested in investing in NFTs, or looking to get into the ticket selling business, our group is the perfect place to start. We provide a supportive community of like-minded individuals who are dedicated to helping each other succeed.
In our group, you'll have access to exclusive tips, strategies, and insights that can help you stay ahead of the competition. We'll also keep you up-to-date on the latest trends and developments in the industry so that you can always make informed decisions.
So if you're ready to take your reselling, NFT collecting, or ticket selling game to the next level, join our group today! You won't regret it.
Here are a few links to get you started on your journey.
https://resellcalendar.com/news/reselling-101/how-to-find-the-best-items-to-resell/?ref=Beadsman_1
https://resellcalendar.com/news/reselling-101/determine-item-value-before-reselling/?ref=Beadsman_1
https://resellcalendar.com/news/news/how-to-buy-the-victor-wembanyama-rookie-card-for-5-99/?ref=Beadsman_1
https://resellcalendar.com/news/news/mad-1-red-watch-resells-for-10000-heres-how-to-get-one/?ref=Beadsman_1
Use this link to join the waitlist.
https://resellcalendar.com/elite/?ref=Beadsman_1
slot dana
(Eugenered, 6. 3. 2023 17:58)
Slot777 adalah situs slot online terpercaya di Indonesia yang menawarkan permainan slot dengan deposit pulsa tanpa potongan. Dengan adanya metode deposit pulsa, pemain dapat dengan mudah mengisi saldo dan bermain di mana saja. Selain itu, situs ini juga menawarkan berbagai provider slot terbaru seperti Pragmatic, Habanero, dan PGsoft.
Selain Slot777, ada juga situs slot online terpercaya lainnya seperti Slot88 yang menyediakan permainan slot dengan tingkat kemenangan yang tinggi. Situs ini juga menawarkan berbagai game slot seperti Slot88 Hong Long Meng, Slot88 Qixi, dan Slot88 Lucky Bats.
Namun, pemilihan situs slot online harus dilakukan dengan hati-hati karena banyak situs yang justru membuat pemain kalah terus. Oleh karena itu, disarankan untuk memilih situs slot yang resmi dan terpercaya seperti Slot777 dan Slot88. Dengan begitu, pemain dapat memainkan permainan slot dengan aman dan meraih kemenangan yang tinggi.
slot777
(Ronaldcheah, 6. 3. 2023 1:24)
Slot777: Main Judi Slot Online dengan Mudah melalui Deposit Pulsa Tanpa Potongan
Judi Slot Online merupakan salah satu permainan yang cukup populer di Indonesia. Dalam beberapa tahun terakhir, Slot Online semakin mudah diakses oleh pemain dengan adanya Slot Deposit Pulsa Tanpa Potongan. Salah satu situs Slot Online Terpercaya yang menawarkan kemudahan tersebut adalah Slot777.
Dengan menggunakan deposit pulsa, para pemain tidak perlu repot lagi untuk melakukan transfer uang ke rekening bank. Para pemain bisa mengisi pulsa mereka di mana saja dengan menggunakan agen-agen pulsa yang tersedia. Kemudahan ini tentu saja mempermudah para pemain, terutama bagi mereka yang tidak memiliki akses ke e-money atau m-banking.
Slot777 menawarkan situs Slot Deposit Pulsa untuk mempermudah para pemain dalam bertransaksi. Dengan begitu, para pemain bisa langsung bermain Slot Online tanpa harus khawatir dengan proses deposit yang rumit. Situs ini juga terkenal sebagai situs judi Slot Online Terpercaya yang melayani deposit menggunakan transfer
sabong free credits
(Eugenered, 5. 3. 2023 16:15)
Sabong is a popular and traditional Filipino sport that involves two roosters fighting against each other. In the Philippines, sabong has been a source of entertainment for many years, and it has recently become popular online. One of the most significant advantages of online sabong is the availability of Sabong Free Credits and Sabong Bonuses, which give players a chance to enjoy the game and win real money without having to risk their own funds.
Sabong Free Credits are offered by many online sabong sites as a way to attract new players and encourage them to try out their services. These credits can be used to place bets on the cockfights and can even be used to watch live fights on your phone or computer. The Sabong Free Credits allow players to experience the thrill of sabong without risking any of their money.
In addition to Sabong Free Credits, many online sabong sites offer Sabong Bonuses to new members. These bonuses can come in many forms, such as cash rewards, free credits, or other incentives that encourage players to sign up and start playing. The most common Sabong Bonus is a 200% bonus for new members, which means that players can receive double their initial deposit.
To start playing sabong online, players need to register on the sabong online registration site. The process is simple and straightforward, and it usually only takes a few minutes to complete. Once you have registered, you can enjoy premium cockfights and international sabong shows from the comfort of your home.
One of the most popular online sabong sites is DS88 Sabong, which offers a wide range of sabong games, including JILISlot, Bingo, and Baccarat. DS88 Sabong also allows players to pay real cash to place bets on cockfights and win real money. The site is safe and secure, and it is fully licensed and regulated by the Philippines' government, ensuring a fair and transparent gaming experience.
In conclusion, Sabong Free Credits and Sabong Bonuses are a great way for players to enjoy sabong online without risking their own money. Online sabong registration is quick and easy, and players can watch live fights on their phones or computers. DS88 Sabong is one of the best online sabong sites, offering a range of games and a safe and secure gaming environment.
JiliCasino
(Eugenered, 5. 3. 2023 14:53)
Goldenplus and JILISlot Gcash Online Casino are two online gaming platforms that offer exciting games and bonuses for their users. One of the attractive features of JILISlot is the free ?88 pesos bonus for new members, which is a great way to start your gaming experience on the platform.
JILI offers a variety of games, including the new color game, bingo, baccarat, and JiliSlot, which are designed to cater to the different preferences of players. They also have a 200% deposit welcome bonus for players who want to maximize their gaming experience on Jili Philippines game station.
If you're looking to earn some extra cash, JILI also offers an ?88 pesos award for those who want to make the most of their gaming experience. The platform is also a legit paying app, which means that you can easily cash out your winnings through Gcash.
JiliCasino, JiliBonus, JiliGames, JiliFree, and JiliSlot are some of the keywords associated with JILISlot Gcash Online Casino. With its user-friendly interface, easy-to-win games, and quick cash-out options, JILISlot is a great platform for players who are looking for an enjoyable and lucrative gaming experience. So, if you want to have fun and earn some cash at the same time, JILISlot Gcash Online Casino is the way to go.
slot777
(Ronaldcheah, 5. 3. 2023 2:30)
Slot777: Main Judi Slot Online dengan Mudah melalui Deposit Pulsa Tanpa Potongan
Judi Slot Online merupakan salah satu permainan yang cukup populer di Indonesia. Dalam beberapa tahun terakhir, Slot Online semakin mudah diakses oleh pemain dengan adanya Slot Deposit Pulsa Tanpa Potongan. Salah satu situs Slot Online Terpercaya yang menawarkan kemudahan tersebut adalah Slot777.
Dengan menggunakan deposit pulsa, para pemain tidak perlu repot lagi untuk melakukan transfer uang ke rekening bank. Para pemain bisa mengisi pulsa mereka di mana saja dengan menggunakan agen-agen pulsa yang tersedia. Kemudahan ini tentu saja mempermudah para pemain, terutama bagi mereka yang tidak memiliki akses ke e-money atau m-banking.
Slot777 menawarkan situs Slot Deposit Pulsa untuk mempermudah para pemain dalam bertransaksi. Dengan begitu, para pemain bisa langsung bermain Slot Online tanpa harus khawatir dengan proses deposit yang rumit. Situs ini juga terkenal sebagai situs judi Slot Online Terpercaya yang melayani deposit menggunakan transfer
Thanks, +
(kzkazfek, 4. 3. 2023 0:01)Cool, I've been looking for this one for a long time
steam desktop authenticator
(Waynejoivy, 2. 3. 2023 0:01)
Steam Desktop Authenticator its a esktop emulator of the Steam authentication mobile application. This program completely replaces the mobile phone. With its help, you can enter Steam, confirm transactions on the market and exchanges.
Source:
- https://gthub.org/Jessecar96/SteamDesktopAuthenticator
steam desktop authenticator
How to Watch UFC 285 MARCH
(MixClots , 1. 3. 2023 22:50)
https://justpaste.it/avdfc/pdf
UFC 285 usa free online stream
How to us google search engine
(Merledouth, 27. 2. 2023 22:09)I would like to as a result of you for the efforts youve got produced in criticism this post. I am hoping the exact verbatim at the same time most https://googles7.com
outgoing to meet you!
(ArthurCRara, 25. 2. 2023 19:56)
Hi,
acute to foregather you! Frustrate me originate myselft
53 year-old Life Scientist Leo from Earlton, loves to spend some time beadwork, and compose music. Likes to see new towns and spots like Historic Fortified Town of Campeche
https://penzu.com/p/8f8dfc30
mega даркнет
(MildredCog, 25. 2. 2023 12:49)
PDF thumbnails from VBA
-
ссылка на мега тор: https://megadmeobo1ahqw2reuqu5gbg6meixia.xyz
Je sais quoi products and drugs solitary here
(Fum, 25. 2. 2023 10:56)
Follow the link and choose the products for your health
Whether you need your medicines urgently or simply want them delivered quickly and efficiently, we have a range of delivery options to choose from.
https://be-healthy.pw/
Potency enhancing drugs
Thanks, I've been looking for this for a long time
(KkkzellIdemi, 25. 2. 2023 4:17)thanks, interesting read
Thanks, I've been looking for this for a long time
(Kzkktomib, 24. 2. 2023 14:20)Cool + for the post
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
Discover the Secrets of Successful Reselling
(JustinBox, 7. 3. 2023 3:33)