-
4 Attachment(s)
PDF Reader ActiveX Control
This is my first post! I am an old French VB6 programmer and you will forgive me for using Google translation furiously!
I have needed an OCX PDF viewer for a long time.
Olaf Schmidt made me discover PDFium.dll in the following post:
http://www.vbforums.com/showthread.p...-ImageExports)
Thank you Olaf!
I made the draft of an ActiveX component PDF viewer which allows
• View PDF files
• Print PDF files
• Extract the text content if it exists
• Practice Character Recognition on the PDF file in conjunction with Tesseract-OCR, open-source OCR software under Apache 2.0 license (https://github.com/tesseract-ocr/tes...ster/README.md)
Attachment 173301
Like Olaf, I use the PDFium version 2018-04-08 / Pdfium-x86-no_v8-no_xfa available on the build service provided by Pieter van Ginkel on GitHub here: https://github.com/pvginkel/PdfiumBu...lds/2018-04-08
As Olaf says: "PDFium (licensed under BSD by Google / Foxit) is the only PDF-reader / viewer-tool I know of, which can be used (and deployed) also in commercial Apps ..."
PDFium.dll must be in the same directory as the ActiveX component
The component has no other dependency than PDFium.dll and the common VB6 files
For Tesseract OCR, Windows installer is available on the following Wiki: https://github.com/UB-Mannheim/tesseract/wiki
I use the 32bit version
A Doc.pdf file in the zip lists the events, methods and properties of the control
Besides Olaf Schmidt, I thank LaVolpe, Dilettante, The Trick, Fafalone, Ellis Dee for their modules gleaned from CodeBank !
Update 2024/12/20
- This new version includes the improvement of the printing of post 29 and the display by bitblt proposed by jtw400 post 35
Attachment 193772 - I made a new version of PDF Reader that uses the new compilations of Pdfium by Benoit Blanchon.
For this to work, it is imperative to load in the VB6 IDE complement of "The Trick" VBCdeclFix
Attachment 193773 - Version with SaveAs function
Attachment 194599
NB: I wanted to thank all the contributors to this forum for their work, which makes it possible to maintain VB6 and to adapt it to Windows evolution. With additional thought for LaVolpe whose codes and tools accompany my work for so many years!
-
Re: PDF Reader ActiveX Control
very good project and control.
Greetings
-
Re: PDF Reader ActiveX Control
Pas mal du tout.
Quelques petits soucis quand on scroll un long PDF trop vite avec la molette, certaines pages ne sont pas affichées.
And for the other
Nice control.
A minor bug when scrolling with the weel mouse oa long PDF. Some pages are not rendered
So now, other can also learn french :)
-
Re: PDF Reader ActiveX Control
Merci Thierry,
Cela est du au temps de conversion de la page PDF en bitmap par la dll PDFium. Je vais chercher à optimiser ça
And for the other...:)
This is due to the conversion time of the PDF page to bitmap by the PDFium dll. I'm going to try to optimize it
-
Re: PDF Reader ActiveX Control
Saturnian, in this case, I suggest to start a new thread that convert in the background all the PDF to BMP
-
Re: PDF Reader ActiveX Control
I can't load any pdf file. Anybody, please, help me. Error #53 "File not found: PDFium".
I have unzipped the PDFReader.zip archive and placed the pdfium.dll in the same folder. Then I have run the PDFReader.vbg and the main form was displayed successfully. But trying to load a file caused the error #53.
I could not register the PDFium library, but, as I understand it, this is not necessary because of LoadLibraryW and FreeLibrary are used.
What am I doing wrong? Shall I compile and/or register an OCX-file?
I have never had a deal with project groups before. So I need help here. :o
-
Re: PDF Reader ActiveX Control
Hello Nouyana
in what procedure and on which line does the error occur?
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
saturnian
Hello Nouyana
in what procedure and on which line does the error occur?
Bonjour saturnian! The only line.
Private Sub Command2_Click()
PDFReader1.SelectPDFFile App.Path
End Sub
Updated1:
in my Error Trapping settings the "Break on Unhandled Errors" option is selected.
Updated2:
When I set the Error Trapping settings to "Break on All Errors" the error occurs on the last line:
Public Function Load(ByVal FileName As String, Optional ShowPDF As Boolean = True) As Boolean
Dim F As Integer, B() As Byte
If Exist(FileName) Then
If PDFLib = 0 Then 'If the PDFium library is not loaded, we load it and initialize it
PDFLib = LoadLibraryW(StrPtr(App.Path & "\PDFium.dll"))
FPDF_InitLibrary
Updated3:
The
Debug.Print App.Path & "\PDFium.dll"
line returns correct path.
OS: WinXP, VB6 professional.
-
Re: PDF Reader ActiveX Control
Nouyana
Your PDFium version probably looks corrupt or not correct. Try reloading it and tell me if things get better
NB you can use this mirror link www.ordoconcept.net/pdfium.dll
this is the dll i use
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
saturnian
Nouyana
Your PDFium version probably looks corrupt or not correct. Try reloading it and tell me if things get better
NB you can use this mirror link
www.ordoconcept.net/pdfium.dll
this is the dll i use
saturnian
these DLLs are really have different md5 sums:
But bouth are work fine under Win10. The problem is only under WinXp. :(
So, I suppose that pdfium.dll doesn't work under Windows XP.
-
Re: PDF Reader ActiveX Control
Nouyana
I have not worked under XP for a long time.
Pieter van Ginkel on GitHub said : "the V8 version does not support Windows XP so if you need support for Windows XP, you need to choose one of the libraries that does not contain V8 support and include an updated version of the dbghelp libraries. These can be found in the Support\dbghelp directory."
Have you tried to download this library? (see : https://github.com/pvginkel/PdfiumBuild )
-
Re: PDF Reader ActiveX Control
I created a virtual machine under XP.
In fact, I have not found a way to make PDFium work.
Despite the claims, this dll does not seem compatible with XP, indeed
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
saturnian
I created a virtual machine under XP.
In fact, I have not found a way to make PDFium work.
Despite the claims, this dll does not seem compatible with XP, indeed
Maybe. Then what was Pieter van Ginkel talking about?
Do you know what the phrase "include an updated version of the dbghelp libraries" means in relation to VB6? Maybe I need to rebuild the pdfium.dll project with dbghelp.dll included? Do you know how to do it? :confused:
-
Re: PDF Reader ActiveX Control
Nouyana, voici un lien sur un autre thread ou Olaf Scmidt donne des compléments d'information sur l'absence de support de PDFium sous XP :
http://www.vbforums.com/showthread.p...=1#post5412903
-
Re: PDF Reader ActiveX Control
Nouyana, here is a link on another thread where Olaf Scmidt gives additional information on the lack of PDFium support in XP :
http://www.vbforums.com/showthread.p...=1#post5412903
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
saturnian
Thank you, saturnian!
So I need someone who can rebuild the project and remove the dependencies on "ieshims.dll" and "wer.dll". It seems too complicated task for me.
ieshims.dll is an artefact of Vista/7 where a shim DLL is used to proxy certain calls (such as CreateProcess) to handle protected mode IE, which doesn't exist on XP, so it is unnecessary. wer.dll is related to Windows Error Reporting and again is probably unused on Windows XP which has a slightly different error reporting system than Vista and above.
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
Nouyana
So I need someone who can rebuild the project and remove the dependencies on "ieshims.dll" and "wer.dll".
If I may ask, what's wrong with the suggestion I made at the end of the "XP-Issue-posting":
IMO (regarding "time to invest" on your end), you'd be better off,
to just move your VB6-stuff over to at least a Win7-installation (or -VM).
If it's your "personal dev-machine", why not simply upgrade to a newer Win-OS?
And in case this needs to be deployed to potentially "thousands of hardcore XP-Users" - is that situation really given in your case?
(do you have information, that there is still a significant percentage of XP-Users among your target-audience)?
Olaf
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
Schmidt
If it's your "personal dev-machine", why not simply upgrade to a newer Win-OS?
Olaf,
I'm not really a developer. I'm, say, power user. The economist. But sometimes i develop programs as a freelancer. There are a lot of reasons for me to use WinXP:
- I know how WinXP works. I have been using it for 16 years.
- At least 200 programs are installed on my computer, and some of them do not work under Win10, including, for example, my old Agnitum outpost firewall. I do not know any really good firewall for Windows today.
- My next OS is Debian Linux + Wine. Not Win10 or 7. Low system recurements are better for Wine (or maybe ReactOS).
- New OS is worth of money. WinXP is still enough for me. If it's interesting for you, I still use MS SQL Server 2000 Developer edition, MS Access 2002 and a lot of other old (but good) stuff in my work.
- Do you need more? I still use floppy and MS-DOS. Why? Just for fun:) But Victoria (official site in Russian and direct link fo latest version with English interface) works better under WinXP, because Win10 API doesn't provide direct access to the ports of the hard disk.
- Here I can say a few bad words about Win10, but I will not do it.
- And yes, I'm not alone. WinXP have at least 5% of market share (I think - even more, especially in Russia, but they are offline)
- I can continue...
Olaf,
if you can rebuild the project, please do it. You will help a lot of people:) 0.831% of programmers uses classic VB. And if 5% of them uses WinXP, and if we have about 20 million developers in the world then 8310 programmers in the world will thank you.:)
-
Re: PDF Reader ActiveX Control
Very nice project! Thanks for posting.
-
Re: PDF Reader ActiveX Control
Hi!
You did a great work with this project ... regrettably, I get a error message when I try to load the sample PDF:
Error 453
Cannot find DLL entry point _FPDF_InitLibrary @ 0 in c:\code\PDFReader\pdfium.dll
I've copied pdfium.dll (Pdfium-x86-no_v8-no_xfa) from https://github.com/pvginkel/PdfiumBu...lds/2018-04-08 into my project folder.
Size: 3,83 MB (4.016.128 bytes)
I've tried to register it with 32 bits regsrv32, but it seems it's not registrable.
I've installed 32 bits Tesseract (but I guess it's not needed if I do not use OCR option)
Error ocurs on:
PDFLib = LoadLibraryW(StrPtr(App.Path & "\PDFium.dll"))
>> FPDF_InitLibrary
I've also copied pdfium.dll from:
https://www.nuget.org/packages/Pdfiu....no_v8-no_xfa/
But no way (I think it's the same)
I'm working on Windows 10 64 Bits / VB6 SP6.
Can anyone help me ? I was searching for such a tool several time, and now I'm so near ... and so far .... :-(
Regards!
Ronald
-
Re: PDF Reader ActiveX Control
Hello Ronald
have you tried the dll downloadable by this link? www.ordoconcept.net/pdfium.dll (see Post #9). This is the one I use under Windows 10 64 bits with VB6-SP6 whithout any issue.
Regards
François
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
saturnian
Hello Ronald
have you tried the dll downloadable by this link?
www.ordoconcept.net/pdfium.dll (see Post #9). This is the one I use under Windows 10 64 bits with VB6-SP6 whithout any issue.
Regards
François
Hi François.
Thank you for your quick answer :-)
I've just downloaded this dll, it's the same I'm using with you code (same SHA512 Hash).
As I see with Dependency Walker (https://www.dependencywalker.com/), the entry points seems right, but I get some errors. I'm not sure if they are relevant:
Error: At least one required implicit or forwarded dependency was not found.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Anyway, I've just installed VB6 on another computer and now it works like a charm. The GetPDFText function is so useful for me .... (automatic invoices accounting).
You've done a great job !
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
RonaldVG
Hi François.
... Anyway, I've just installed VB6 on another computer and now it works like a charm. The GetPDFText function is so useful for me .... (automatic invoices accounting). ...
I am pleased,
although this does not solve the problem on the initial machine?? VB6 Installation issue ??
Kindly
François
-
Re: PDF Reader ActiveX Control
Hi saturnian
With the link in your post #21 all works fine.
Thank you
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
saturnian
I am pleased,
although this does not solve the problem on the initial machine?? VB6 Installation issue ??
Not sure. I've compiled OrdoPDFReader.ocx on the new VB6 machine.
I'm trying to use it on a third machine (Windows 2008 32 bits) with correct PDFium.dll, using VBA.
I get same message (Cannot find DLL entry point _FPDF_InitLibrary@0 in PDFium).
I guess PDFium.dll requires some specific configuration.
I shall try more configurations to see if I can find the pattern ....
-
Re: PDF Reader ActiveX Control
Hi,
Thanks a lot for your code. My problem is that when printing, it is in low quality. Is there a way to define print quality ?
La qualité d'impression est comme floue par rapport à une impression avec Acrobat. Comme si on imprimait une image en basse résolution.
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
Crapahute
Hi,
Thanks a lot for your code. My problem is that when printing, it is in low quality. Is there a way to define print quality ?
Maybe you can print directly your PDF file:
ShellExecute 0&, "Print", "C:\yourfilepath.pdf", "", "", vbNormalFocus
Regards!
-
Re: PDF Reader ActiveX Control
Thanks. I knew this way but I was looking for a solution without using Adobe Reader
Anyway, thanks again.
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
Crapahute
Hi,
Thanks a lot for your code. My problem is that when printing, it is in low quality. Is there a way to define print quality ?
La qualité d'impression est comme floue par rapport à une impression avec Acrobat. Comme si on imprimait une image en basse résolution.
Hello Crapahute,
C'est très sympathique de voir quelques mots en français sur ce forum !
It's very nice to see a few words in French on this forum!
The component is a simplified version that prints PDFs in Draft mode.
To improve print quality:
In the PDFReader Control add, in the declarations:
Code:
Public Enum oPrinterQuality
[opqDraft] = 72
[opqLow] = 150
[opqStandard] = 300
[opqHigh] = 600
[opqMax] = 1200
End Enum
In the same module, replace the PrintPDF procedure with the following procedure:
Code:
Public Sub PrintPDF(Optional Copies As Integer = 1, Optional Orientation As oPrinterOrientation = oAuto, Optional FromPage As Integer = 0, Optional ToPage As Integer = 0, Optional PrinterName As String = "", Optional PrinterQuality As oPrinterQuality = opqStandard)
Dim X As Printer, Imp_defaut$, F As Integer, i As Integer
Dim imp_actuelle$
Dim Page_Height As Double, Page_Width As Double
Dim row As Integer
Dim column As Integer, Width As Double, Height As Double, top As Long, left As Long, zoom As Double, columns As Integer, rows As Integer
Dim vpos As Long, hpos As Long
Dim margin As Integer, colour As Long, backcolour As String
Dim HZoom As Double
If NbPage = 0 Then Exit Sub
'We keep the current printer
imp_actuelle$ = Printer.DeviceName
'Check if the right printer exists
If PrinterName <> imp_actuelle$ And PrinterName > "" Then
'If yes, change the default printer
For Each X In Printers
If X.DeviceName = PrinterName Then
Set Printer = X
Exit For
End If
Next
End If
If Copies < 1 Then Copies = 1
If Copies > 999 Then Copies = 999
If FromPage < 1 Then FromPage = 1
If FromPage > NbPage Then FromPage = 1
If ToPage = 0 Then ToPage = NbPage
If ToPage > NbPage Then ToPage = NbPage
If ToPage < FromPage Then ToPage = FromPage
'Printer.Copies
For i = 1 To Copies
'Printer initialization
Start:
'Here we set the print quality *****************************************************
Page_Height = PageHeightPoints(0) * ConvertPointToTwips * (PrinterQuality / 72)
Page_Width = PageWidthPoints(0) * ConvertPointToTwips * (PrinterQuality / 72)
PictureOCR.Height = Page_Height
PictureOCR.Width = Page_Width
If Page_Height - PictureOCR.Height > 2 Or Page_Width - PictureOCR.Width > 2 Then ' we have exceeded the maximum size of a picturebox
PrinterQuality = PrinterQuality / 2 ' we reduce the quality and start again
GoTo Start
End If
If Orientation = oAuto Then
If Page_Width <= Page_Height Then Orientation = oPortrait Else Orientation = oLandscape
End If
Printer.Orientation = Orientation
margin = 0 ' 150
top = Printer.ScaleTop '+ margin
left = Printer.ScaleLeft '+ margin
columns = 1 ' to modify if you want to print several pages per sheet
rows = 1
Width = (Printer.ScaleWidth + margin) / columns - margin '(margin * 2)
Height = (Printer.ScaleHeight + margin) / rows - margin '(margin * 2)
hpos = left + (columns - 1) * (Width + margin)
vpos = top + (rows - 1) * (Height + margin)
'check whether width or height is limiting factor
zoom = Width / Page_Width
If zoom < Height / Page_Height Then
' width limited
vpos = vpos + (Height - Page_Height * zoom) / 2
HZoom = Width / Printer.Width
Else
' height limited
zoom = Height / Page_Height
hpos = hpos + (Width - Page_Width * zoom) / 2
HZoom = Height / Printer.Height
End If
For F = FromPage To ToPage
'we draw, store and print the image of the page
KillFile AddDirSep(KnownFolder(kfUserAppDataLocal)) & "Temp\OrdoPDF.bmp"
PictureOCR.Cls
PictureOCR.Picture = Nothing
Page_Height = PageHeightPoints(F - 1) * ConvertPointToTwips * (PrinterQuality / 72)
Page_Width = PageWidthPoints(F - 1) * ConvertPointToTwips * (PrinterQuality / 72)
PictureOCR.Height = Page_Height
PictureOCR.Width = Page_Width
DoEvents
RenderPageToDC PictureOCR.hdc, F - 1, 0, 0, PictureOCR.Width, PictureOCR.Height
PictureOCR.Picture = PictureOCR.Image
DoEvents
' We print the picture box content
Printer.PaintPicture PictureOCR.Picture, hpos, vpos, PictureOCR.Width * zoom, PictureOCR.Height * zoom
Printer.NewPage
Next F
Printer.EndDoc
Next i
'Possible replacement of the default printer
If imp_actuelle <> Printer.DeviceName Then
For Each X In Printers
If X.DeviceName = imp_actuelle Then
Set Printer = X
Exit For
End If
Next
End If
End Sub
It is then possible to choose the print quality from 72 dpi to 1200 dpi, by entering the optional PrinterQuality variable.
Best regards
François
-
Re: PDF Reader ActiveX Control
Vive la Belgique aussi :)
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
Thierry69
Vive la Belgique aussi :)
Absolument ! :wave:
-
Re: PDF Reader ActiveX Control
Génial, cela fonctionne, un énorme merci. :)
Thank you very much, you rock.
-
Re: PDF Reader ActiveX Control
This is a great project! I modified it a little to draw to an offscreen DC and then bitblt to the picture box. That helps display more complicated PDFs faster.
In the list of PDFium functions from Olaf's PDF project I saw the FPDF_RenderPage_Start and FPDF_RenderPage_Continue functions which use a callback to progressively draw a page. With more complex PDFs (architectural plans, etc.) an app can appear to hang while drawing so perhaps these functions could provide some indication to the user of the drawing progress.
Anyone have any ideas implementing this is VB? Thanks!
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
jtw400
This is a great project! I modified it a little to draw to an offscreen DC and then bitblt to the picture box. That helps display more complicated PDFs faster....
Hello jtw400,
it would be nice to post these changes in this thread, so that the community can test and integrate them.
Thanks in advance
Best regards
François
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
saturnian
Hello jtw400,
it would be nice to post these changes in this thread, so that the community can test and integrate them.
Thanks in advance
Best regards
François
Here you go... use this whenever needed to draw a page from a PDF already opened with "PDFLoad"
Code:
Dim TempDC As Long, TempBMP As Long, hDesktop As Long, hBrush As Long, pRect As RECT
hDesktop = GetDesktopWindow()
GetClientRect PDFView.hwnd, pRect
TempDC = CreateCompatibleDC(GetDC(hDesktop))
TempBMP = CreateCompatibleBitmap(PDFView.hdc, pRect.Right, pRect.Bottom)
SelectObject TempDC, TempBMP
hBrush = CreateSolidBrush(RGB(255, 255, 255))
FillRect TempDC, pRect, hBrush
RenderPageToDC TempDC, nPage - 1, 0, 0, pRect.Right * Screen.TwipsPerPixelX, pRect.Bottom * Screen.TwipsPerPixelY
BitBlt PDFView.hdc, 0, 0, pRect.Right, pRect.Bottom, TempDC, 0, 0, vbSrcCopy
DeleteDC TempDC
DeleteObject TempBMP
DeleteObject hBrush
'///// Declarations
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function GetDC Lib "user32.dll" (ByVal hWnd As Long) As Long
Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hDC As Long) As Long
Declare Function DeleteDC Lib "gdi32" (ByVal hDC As Long) As Long
Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Declare Function FillRect Lib "user32" (ByVal hDC As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
-
Re: PDF Reader ActiveX Control
-
Re: PDF Reader ActiveX Control
miniblink.dll ,maybe can show pdf ,it's like chrome
-
Re: PDF Reader ActiveX Control
And here we are, some 2+ years later :). Thank you for your hard work on this, it works well for me. I'm using the demo program as my default PDF viewer on my personal computer because it is small, fast, and not annoying like Acrobat reader and others. Bravo to you and all of the other contributors :).
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
SomeYguy
And here we are, some 2+ years later :). Thank you for your hard work on this, it works well for me. I'm using the demo program as my default PDF viewer on my personal computer because it is small, fast, and not annoying like Acrobat reader and others. Bravo to you and all of the other contributors :).
Glad this code can help you!
Thanks for this kind message and thanks for thinking of all the contributors!
Sincerely
Saturnian
-
Re: PDF Reader ActiveX Control
can't make an executable file out of it. Says the .vbp is not a compatible binary file. Anyone else have this problem ?
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
KFrosty
can't make an executable file out of it. Says the .vbp is not a compatible binary file. Anyone else have this problem ?
This issue occurs because the ocx has not been compiled and the interpreted test project is only linked to the uncompiled component.
To fix this:
- Load the PDFReader.vbg project group, close all code and design Windows
- Compile the OrdoPDFReader ocx for the first time
- Then modify the PDF_Reader project properties: Component tab: Version Compatibility: Binary Compatibility: Choose OrdoPDFReader.ocx
- Compile OrdoPDFReader.ocx again for a 2nd time
- SAVE the project group
- Quit VB6 and restart it, load the PDFReader.vbg project group
- It should be possible to compile the TestPDFReader Test project!
I hope this will solve your problem
Best Regards
François
-
Re: PDF Reader ActiveX Control
Microsoft has plans to scrap the Windows 7 operating system. In conjunction with Intel, the new CPU does not offer Win7 graphics drivers.
In terms of software and many other aspects, we should actively shut down many excellent software projects or operating systems.
It's like every time the Apple system is updated or forced to push. It is hoped that the old users will feel that the mobile phone is very slow, and then they have to buy a new mobile phone.
There is a programmer in China who can even recompile the XP ie source code into a very small single DLL file.
Just like the tool you use to display PDF pages.
In the past, a web browser kernel was only 3 to 10 MB in size, but now new browsers have reached 500 MB-1gb
Lots of great open source UI components or something like libcurl, lIBMysql. DLL.
Because of the incompatibility of various systems, there may be fewer functions or abnormal operation.
So we also need a good package manager. There are also a large number of various third-party component DLLs.
It needs to show compatibility with various operating systems.
Perhaps this requires that twinbasic provide the server and technology. Realize NPM. Exe and nuget. Exe for VB6 users.
-
Re: PDF Reader ActiveX Control
This is not really a thread about different OS. If people want to stick with older operating systems, that is up to them, but they do get to contend with the consequences of doing so. That's also up to them, and a good topic for a different thread.
-
Re: PDF Reader ActiveX Control
@Xiaoyao
Your off-topic posts that are polluting the discussion threads are becoming unbearable!
You're completely discrediting yourself, and like many others, I've come to ignore all of your contributions (I was forced to read this one since I started this thread!)
Our moderators are very kind and magnanimous!
Please follow their advice and create new threads when an idea comes to mind.
-
Re: PDF Reader ActiveX Control
sorry A little off topic.
I hope that some source codes developed can indicate whether they support 64-bit VBA/TWINBASC,32 and 32-bit systems, and whether they support XP, Win 10 and Win 11.
It would be better if 64-bit and 32-bit DLLs could be provided at the same time. For example, the COM static editing package of SQLIT3 is only available in 32-bit version at present.
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
Nouyana
Thank you, saturnian!
So I need someone who can rebuild the project and remove the dependencies on "ieshims.dll" and "wer.dll". It seems too complicated task for me.
ieshims.dll is an artefact of Vista/7 where a shim DLL is used to proxy certain calls (such as CreateProcess) to handle protected mode IE, which doesn't exist on XP, so it is unnecessary. wer.dll is related to Windows Error Reporting and again is probably unused on Windows XP which has a slightly different error reporting system than Vista and above.
VeryPDF PDFView OCX v2.1.0.1
http://www.verydoc.com/pdf-viewer-ocx.html
VeryDOC PDF Viewer OCX Control (ActiveX) is a PDF file viewer component. PDF Viewer OCX Control provides a standalone embeddable PDF Viewer for windows application developers. Using Visual Basic, VC, Delphi, C#, HTML (Internet Explorer) or any other programming languages or tools been able to handle ActiveX controls, developers can build a customer interface for viewing PDF documents. PDF documents can be loaded from disk files easily. PDF Viewer OCX Control is usually used to quickly display PDF files created by any PDF creation software. If you need to embed a PDF viewer into your application without depend on Adobe Reader, VeryDOC PDF Viewer OCX control will be your best choice.
Features:
View PDF Documents quickly, without depend on Adobe Reader
Provide the developer with full control over the PDF viewer, you can add PDF viewing capability to your applications easily
Search a PDF document for a specific text
Jump to an outline object destination
Display document outlines
Scroll/Zoom the viewer window (Actual Page, Fit Page, Fit Width, ..)
View PDF pages in different layout modes (Single Page, Facing, Continuous, Continuous Facing)
Select text on the PDF pages, copy text to clipboard
Support for PDF hyperlinks
Region highlighting for text search
Work with Visual Basic, Delphi, Internet Explorer, and any other ActiveX-compatible development environment
Support all version of Acrobat PDF files
Support 2000/XP/Vista, 32bit and 64bit, Windows platforms
-
Re: PDF Reader ActiveX Control
@saturnian, do you think it's so complicated to create a Merge/ split pdf function ?
i'm trying to do it but.. :-(
Edit: and.. updating to a new pdfium.dll (https://github.com/bblanchon/pdfium-binaries/releases) will be hard to do i think, isn't it ?
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
Calcu
I will try to take a look at this as soon as I have a free moment.
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
Calcu
I made such a program in twinBASIC. The most recent version uses newer bblanchon pdfium builds; then if you get the old version it uses the 8 year old outdated pvginkel builds which the only advantage is using stdcall, however to do this in VB6 instead you'd need The trick's VBCdeclFix anyway even with the older pdfium builds because the write callback must be CDecl. All the more reason to just use tB :) ...or at very least the new pdfium builds since you can't avoid _cdecl if you're going to use the FPDF_SaveAsCopy function.
[twinBASIC] gPdfMerge - A GUI-based PDF merger
https://github.com/fafalone/gPdfMerge
As mentioned, the first version of the project, which doesn't have the search for pages function and a couple other enhancements, uses the same pvginkel builds as this project: https://github.com/fafalone/gPdfMerg...a3a92fea52361f
--
I've been meaning to port saturnian's wonderful project here to tB/64bit too but haven't had time yet.
-
Re: PDF Reader ActiveX Control
I tried to do by myself, but my knowlegde is not enough.
I didn't knew about trick's VBCdeclFix, let's see if i can implement it.
I will take a look at twinbasic too, just downloaded it and executed... seems pretty "VB6" to me xD, i hope the learning curve will be easy for me
-
Re: PDF Reader ActiveX Control
twinBASIC is meant to be fully backwards compatible with VB6. Essentially a real VB7. That's why I answer with code from it or links to projects for it; it's the same language, and usually backporting to VB6 when new features are used is very simple .
VBCDeclFix is an addin for VB6 that lets you use CDecl in API declares and functions. All you have to do is enable it and then you can use the CDecl keyword in VB6, e.g. Private Declare Function FPDF_SaveAsCopy CDecl Lib "pdfium" ... and Private Function WriteBlock CDecl(.... In twinBASIC no addin is needed; that's supported natively with the same syntax.
-
Re: PDF Reader ActiveX Control
Hey so I've been working on a 64-bit compatible twinBASIC port, which also uses the newer pdfium builds from https://github.com/bblanchon/pdfium-binaries/releases
I'm actually having a bit of trouble getting the VB6 version to work for comparison; I was wondering if someone could provide some feedback about glitches so I know if they're tB bugs or general rendering bugs...
https://github.com/fafalone/OrdoPdfReader64
The test project ports in the win32 and win64 folders will need to remove the old control/reference and re-place it if you use them; I set everything to be an entirely new control before posting (this means it won't interfere with the original if you have it).
-
Re: PDF Reader ActiveX Control
I made a new version of PDF Reader that uses the new compilations of Pdfium by Benoit Blanchon.
This version includes the improvement of the printing of post 29 and the display by bitblt proposed by jtw400 post 35
For this to work, it is imperative to load in the VB6 IDE the complement of "The Trick" VBCdeclFix
The source is downloadable here
I will try to take the example of Fafalone's TwinBasic gPdfMerge code to integrate a MergePDF function.
I need to install TwinBasic to try to understand the problems that Fafalone encounters during his porting test.
Best wishes to all!
François
NB: The first post has been updated with these new features.
-
Re: PDF Reader ActiveX Control
Thanks both
i will try to use the new version and try to beta-test the fafalone version ! (this way i will begin with TB)
-
Re: PDF Reader ActiveX Control
Hi everyone! This PDF project is really great, and when I integrated into my own program, it basically works well... except for one thing. The PrintPDFWithDialog function brings up the print dialog, I select the printer and then press "Print" but nothing happens. What could be the reason for this? The regular PrintPDF prints just fine.
Another question/idea: Would it be possible to add options for duplex printing and color/b&w selection to the PrintPDF function?
And one more thing: The PrintPDFWithDialog function mentioned above is not documented in the Help section here: https://freeware.ordoconcept.net/help/OrdoPDFReader3/
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
DTZlevelei
Hi everyone! This PDF project is really great, and when I integrated into my own program, it basically works well... except for one thing. The PrintPDFWithDialog function brings up the print dialog, I select the printer and then press "Print" but nothing happens. What could be the reason for this? The regular PrintPDF prints just fine.
I can't reproduce this issue on Windows 10. What printer do you select and on what OS? What version of OrdoPDFReader are you using?
Quote:
Another question/idea: Would it be possible to add options for duplex printing and color/b&w selection to the PrintPDF function?
In the next version a PrintPDFEx method will allow you to select duplex mode and monochrome or color printing in addition to the already available settings
Best regards
François
-
Re: PDF Reader ActiveX Control
Hi!
Found some time finally to test the new version, i couldn't compile it, and neither execute it.
Then i created a new project from scratch, added your usercontrol, all the classes and bas modules and it worked like a charm. I compiled this project and worked too.
BUT
i tried to use the new usercontrol in my big project (the one that was using your previous version) and .... in IDE it works perfect, but when i compile it, it fails doing FPDF_InitLibrary
any idea why it works in a new project, but no in an old one (that was using your last version of the usercontrol) ?
Thanks for everything!
Ah.. is this a mistake? i can see:
Private Declare Sub FPDF_DestroyLibary CDecl Lib "pdfium.dll" ()
Maybe it has to be FPDP_DestroyLibRary ?
-
Re: PDF Reader ActiveX Control
Quote:
Originally Posted by
Calcu
Hi!
Found some time finally to test the new version, i couldn't compile it, and neither execute it.
Then i created a new project from scratch, added your usercontrol, all the classes and bas modules and it worked like a charm. I compiled this project and worked too.
BUT
i tried to use the new usercontrol in my big project (the one that was using your previous version) and .... in IDE it works perfect, but when i compile it, it fails doing FPDF_InitLibrary
any idea why it works in a new project, but no in an old one (that was using your last version of the usercontrol) ?
Thanks for everything!
Hi Calcu,
Are you sure which version of pdfium.dll you are loading in your old updated project? To avoid confusion I renamed the new dlll Pdfium_X86.dll, which allows you to have both versions on the same system without any risk of confusion.
Is the VB6 CDeclFix add-in from The Trick active in your IDE when you use the code of the new version?
Quote:
Ah.. is this a mistake? i can see:
Private Declare Sub FPDF_DestroyLibary CDecl Lib "pdfium.dll" ()
Maybe it has to be FPDP_DestroyLibRary ?
That's a typo, indeed.
Best regards
François
-
Re: PDF Reader ActiveX Control
Hi!
Tried everything and found the problem/solution!
I was compiling to P-Code, just changed to Native code, optimized to fast code, and now it works !
It was a nonsense if it was working on IDE, but not compiled...
Waiting for your merge function xD
-
Re: PDF Reader ActiveX Control
I've posted an updated x64 compatible tB version with the new changes merged in. The BitBlt rendering got rid of the glitches I noticed last time, but consider this a BETA for testing only while I try to figure out an issue I'm having with MouseDown; it's making Windows UI freak out; causing flashing/redrawing of all windows while the mouse lags. Unknown if the VB6 version does this to and it's a me issue, but I won't get a chance to investigate til tomorrow and wanted to go ahead and post it.
https://github.com/fafalone/OrdoPdfReader64
OrdoPDFReader64v2.twinproj
NOTE: It's configured to compile as an entirely separate control; it doesn't interfere with the VB6 version or my previous tB version. If you want to change this behavior, you'll have to put back the project and class names, project guid, typelib version, and class id/interface id/event interface id to the old one. I left the old file up.