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://agro-portal.su/fednews_apk/5519-glava-komiteta-po-agrarnym-voprosam-rf-vystupil-s-rechyu.html
lucrare de licenta
(Williamkab, 20. 5. 2023 17:09)
Site lucrari de licenta. Inspirat site lucrari de licente site lucrari-de-licenta-diploma.com site lucrari-de-licenta-diploma.com lucrari-de-licenta-diploma.com site uri seriose lucrari de licenta. Site-uri cu lucrari de licenta. Gratis site-uri lucrari de licenta. Situri lucrari de licenta. Persoane care percep avansul societati de asigurari care primesc studenti pt lucrara de licenta stadiul lucrarii de licenta stagiu de pregatire a lucrarii de licenta standarde de elaborare a lucrari licenta medicina standarde de elaborare a lucrarii de licenta umft standarde de redactare a copertii lucrarii de licenta stef legatorie lucrari de licenta. Structira lucrarii de licenta umft structura lucrarii de licenta asistenta sociala structura lucrarii de licenta info structura lucrarii de licenta medicina structura lucrarii de licenta medicina oradea structura lucrarii de licenta oficiala structura lucrarii de licenta power point structura lucrarii de licenta snspa structura lucrarii de licenta ulbs structura lucrarii de licenta umf structura lucrarii de licenta umfst tg mures 2019 structura lucrarii de licenta umft structura lucrarii de licenta unitbv structura lucrarii de licenta usv litere structura lucrarii de licenta utcn structura lucrarii de licenta utcn etti structura lucrarilor de licenta ubb cluj structura unei lucrari de licenta. Structura unei lucrari de licenta. Ase structura unei lucrari de licenta. Ase lma ase structura unei lucrari de licenta. Limbi straine structura unei lucrari de licenta. Matematica informatica structura unei lucrari de licenta. Psihologie structurarea lucrarii de licenta structurarea unei lucrari de licenta. Student iq-cele 10 etape ale lucrarii de licenta student iq-cele 10 stadii ale lucrarii de licenta subiecte de lucrari de licenta. Radiologie sumarul lucrari de licenta. Despre mediu sumarul lucrarii de licenta sumarul lucrarii de licenta 2019 surse secundare in elaborarea lucrarii de licenta pentru o firma surse secundare interne si externe in elaborarea lucrarii de licenta sustinerea lucrarii de licenta sustinerea lucrarii de licenta drept sustinerea lucrarii de licenta in fata comisiei sustinerea lucrarii de licenta incluziune sustinerea lucrarii de licenta proba cunostintelor generale sustineri lucrari de licenta. Inginerie hidrotehnica sute de lucrari de licenta.
Modern economic problems
(DamiankEw, 18. 5. 2023 14:04)
https://chestyle.com/lj/20100628_1.php
Modern economic problems
(DamiankEw, 18. 5. 2023 14:03)
https://chestyle.com/lj/20100628_1.php
Modern economic problems
(DamiankEw, 18. 5. 2023 14:01)
https://chestyle.com/lj/20100628_1.php
Modern economic problems
(DamiankEw, 18. 5. 2023 13:59)
https://chestyle.com/lj/20100628_1.php
Modern economic problems
(DamiankEw, 18. 5. 2023 13:58)
https://chestyle.com/lj/20100628_1.php
ChatGpt
(ChatGPTtic, 18. 5. 2023 0:33)
Revolutionizing Conversational AI
ChatGPT is a groundbreaking conversational AI model that boasts open-domain capability, adaptability, and impressive language fluency. Its training process involves pre-training and fine-tuning, refining its behavior and aligning it with human-like conversational norms. Built on transformer networks, ChatGPT's architecture enables it to generate coherent and contextually appropriate responses. With diverse applications in customer support, content creation, education, information retrieval, and personal assistants, ChatGPT is transforming the conversational AI landscape.
Literary analysis the outsiders
(Buy Essay tre, 17. 5. 2023 19:20)
Literary analysis the outsiders https://bbeyeler.de/hallo-welt/
BITCOIN MONEY SEARCH SOFTWARE
(LamaSmity, 14. 5. 2023 4:34)
I want to show you one exclusive program called (BTC PROFIT SEARCH AND MINING PHRASES), which can make you a rich man, and maybe even a billionaire!
This program searches for Bitcoin wallets with a balance, and tries to find a secret phrase for them to get full access to the lost wallet!
Run the program and wait, and in order to increase your chances, install the program on all computers available to you, at work, with your friends, with your relatives, you can also ask your classmates to use the program, so your chances will increase tenfold!
Remember the more computers you use, the higher your chances of getting the treasure!
Video:
https://www.youtube.com/watch?v=cOLX3g6ByR4
Telegram:
https://t.me/btc_profit_search
Canadian News Today
(micheal#decosta[OjoltozEjuzutiVT,2,5], 13. 5. 2023 14:16)
Canadian News Today is your source for the latest news, video, opinions and analysis from Canada and around the world.
Find more details : https://www.canadiannewstoday.com/
娛樂城
(Jasoncet, 12. 5. 2023 17:18)
娛樂城
福佑娛樂城致力於在網絡遊戲行業推廣負責任的賭博行為和打擊成癮行為。 本文探討了福友如何通過關注合理費率、自律、玩家教育和安全措施來實現這一目標。
理性利率和自律:
福佑娛樂城鼓勵玩家將在線賭博視為一種娛樂活動,而不是一種收入來源。 通過提倡合理的費率和設置投注金額限制,福佑確保玩家參與受控賭博,降低財務風險並防止成癮。 強調自律可以營造一個健康的環境,在這個環境中,賭博仍然令人愉快,而不會成為一種有害的習慣。
關於風險和預防的球員教育:
福佑娛樂城非常重視對玩家進行賭博相關風險的教育。 通過提供詳細的說明和指南,福佑使個人能夠做出明智的決定。 這些知識使玩家能夠了解他們行為的潛在後果,促進負責任的行為並最大限度地減少上癮的可能性。
安全措施:
福佑娛樂城通過實施先進的技術解決方案,將玩家安全放在首位。 憑藉強大的反洗錢系統,福友確保安全公平的博彩環境。 這可以保護玩家免受詐騙和欺詐活動的侵害,建立信任並促進負責任的賭博行為。
結論:
福佑娛樂城致力於培養負責任的賭博行為和打擊成癮行為。 通過提倡合理的費率、自律、玩家教育和安全措施的實施,富友提供安全、愉快的博彩體驗。 通過履行社會責任,福佑娛樂城為其他在線賭場樹立了積極的榜樣,將玩家的福祉放在首位,營造負責任的博彩環境。
viagra sans ordonnance viagra pas cher
(prxviagra.com, 12. 5. 2023 1:30)https://sildfrance.com/ pilule viagra
Essay on computers today
(Buy Essay atj, 12. 5. 2023 0:20)
Essay on computers today https://www.transtats.bts.gov/exit.asp?url=https://essaypro.pro
Resume for entry level it job
(Buy Essay ixp, 10. 5. 2023 3:43)
Resume for entry level it job https://www.google.com.sa/url?q=https://essayservice.discount/codes/speedypaper/
Custom blog post proofreading sites for university
(Buy Essay qhh, 8. 5. 2023 13:43)
Custom blog post proofreading sites for university https://www.mixcloud.com/shielddibble26/
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
Modern economic problems
(Matthewmef, 20. 5. 2023 22:28)