Skip to content

Commit

Permalink
1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriychunikhin committed Jul 8, 2024
1 parent 5575568 commit 36a134c
Show file tree
Hide file tree
Showing 18 changed files with 2,695 additions and 2,487 deletions.
49 changes: 14 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ pdfium-vfp is a open source PDF viewer control for Visual Fox Pro 9 SP2 based on
* Viewing PDF files
* Text selection and copying
* Text searching
* Printing PDF
* Multiple control instances
* VFP frx reports previewing, printing and saving (in pdf) without HighDPI pain in the neck
* VFP frx reports previewing, printing and saving (in pdf) without High DPI pain in the neck

### Minumum system requirements
* Windows Vista SP 2
Expand Down Expand Up @@ -80,6 +81,12 @@ REPORT FORM Report2.frx OBJECT loPdfiumReport PREVIEW
loPdfiumReport.BatchEnd()
** OR **
REPORT FORM Report1.frx OBJECT loPdfiumReport NOPAGEEJECT
REPORT FORM Report2.frx OBJECT loPdfiumReport PREVIEW
*******************************************
* Saving report output to the file
*******************************************
Expand All @@ -90,6 +97,12 @@ REPORT FORM Report2.frx OBJECT loPdfiumReport TO FILE "some.pdf"
loPdfiumReport.BatchEnd()
** OR **
REPORT FORM Report1.frx OBJECT loPdfiumReport NOPAGEEJECT
REPORT FORM Report2.frx OBJECT loPdfiumReport TO FILE "some.pdf"
```

#### As _REPORTOUTPUT ####
Expand Down Expand Up @@ -124,40 +137,6 @@ FINALLY
ENDTRY
```

### Remarks on Printing From Preview Window (should be read)
So far, PdfiumReport printing from preview use `REPORT FORM` replaying approarch, thus `report form` environment must not be changed before BatchEnd will be called or PdfiumReport variable will be released. If you use PdfiumReport.app as _REPORTOUTPUT all mentioned here doesn't need.

Example
```foxpro
LOCAL loPdfiumReport
loPdfiumReport = NEWOBJECT(;
"PdfiumReport", "pdfium-vfp.vcx", "pdfiumreport.app")
REPORT FORM Report1.frx OBJECT loPdfiumReport NOPAGEEJECT
REPORT FORM Report2.frx OBJECT loPdfiumReport PREVIEW
* loPdfiumReport.BatchEnd()
loPdfiumReport = .F. && Call BatchEnd or release PdfiumReport object right after the last `REPORT FORM` of your batch or Preview Window will not be opened
** OR **
LOCAL loPdfiumReport
loPdfiumReport = NEWOBJECT(;
"PdfiumReport", "pdfium-vfp.vcx", "pdfiumreport.app")
loPdfiumReport.BatchBegin()
REPORT FORM Report1.frx OBJECT loPdfiumReport NOPAGEEJECT
REPORT FORM Report2.frx OBJECT loPdfiumReport PREVIEW
loPdfiumReport.BatchEnd() && Call BatchEnd or release PdfiumReport object right after the last `REPORT FORM` of your batch or Preview Window will not be opened
* loPdfiumReport = .F.
```



### Binaries
What binaries exactly do you need to run all the stuff (or your own latest version of it)
Expand Down
Binary file modified Sample/report1.FRT
Binary file not shown.
4 changes: 2 additions & 2 deletions Sample/report1.fr2

Large diffs are not rendered by default.

Binary file modified Sample/report1.frx
Binary file not shown.
Binary file modified Sample/report2.frx
Binary file not shown.
Binary file modified Sample/sample.exe
Binary file not shown.
Binary file modified Sample/sample.pjt
Binary file not shown.
Binary file modified Sample/sample.pjx
Binary file not shown.
34 changes: 16 additions & 18 deletions Sample/sample.sc2
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ DEFINE CLASS sample AS form
Top = 6, ;
Visible = .T., ;
Width = 480, ;
CMDFOCUS.Name = "CMDFOCUS", ;
cmdFocus.Name = "cmdFocus", ;
env.Name = "env", ;
I18N.Name = "I18N", ;
UISTATE.Name = "UISTATE"
i18n.Name = "i18n", ;
UIState.Name = "UIState"
*< END OBJECT: ClassLib="..\source\pdfium-vfp.vcx" BaseClass="control" />

ADD OBJECT 'Pageframe1.Page1.Pageframe2.Page2.Pdfiumviewer' AS pdfiumviewer WITH ;
Expand All @@ -296,10 +296,10 @@ DEFINE CLASS sample AS form
Top = 8, ;
Visible = .T., ;
Width = 441, ;
CMDFOCUS.Name = "CMDFOCUS", ;
cmdFocus.Name = "cmdFocus", ;
env.Name = "env", ;
I18N.Name = "I18N", ;
UISTATE.Name = "UISTATE"
i18n.Name = "i18n", ;
UIState.Name = "UIState"
*< END OBJECT: ClassLib="..\source\pdfium-vfp.vcx" BaseClass="control" />

ADD OBJECT 'Pageframe1.Page2.Pdfiumviewer' AS pdfiumviewer WITH ;
Expand All @@ -315,10 +315,10 @@ DEFINE CLASS sample AS form
Top = 43, ;
Visible = .T., ;
Width = 480, ;
CMDFOCUS.Name = "CMDFOCUS", ;
cmdFocus.Name = "cmdFocus", ;
env.Name = "env", ;
I18N.Name = "I18N", ;
UISTATE.Name = "UISTATE"
i18n.Name = "i18n", ;
UIState.Name = "UIState"
*< END OBJECT: ClassLib="..\source\pdfium-vfp.vcx" BaseClass="control" />

ADD OBJECT 'Pdfium_env' AS pdfium_env WITH ;
Expand All @@ -343,10 +343,10 @@ DEFINE CLASS sample AS form
Top = 108, ;
Visible = .T., ;
Width = 636, ;
CMDFOCUS.Name = "CMDFOCUS", ;
cmdFocus.Name = "cmdFocus", ;
env.Name = "env", ;
I18N.Name = "I18N", ;
UISTATE.Name = "UISTATE"
i18n.Name = "i18n", ;
UIState.Name = "UIState"
*< END OBJECT: ClassLib="..\source\pdfium-vfp.vcx" BaseClass="control" />

ADD OBJECT 'shpSearch' AS shape WITH ;
Expand Down Expand Up @@ -691,7 +691,7 @@ DEFINE CLASS sample AS form
#define REPOBJ_VARIANT 1

DO CASE
CASE 1 = REPOBJ_VARIANT && global scoped _REPORTOUTPUT
CASE 1 = REPOBJ_VARIANT && global scope _REPORTOUTPUT

SET REPORTBEHAVIOR 90

Expand All @@ -712,7 +712,7 @@ DEFINE CLASS sample AS form
_REPORTOUTPUT = lSave_REPORTOUTPUT
ENDTRY

CASE 2 = REPOBJ_VARIANT && local scoped batch
CASE 2 = REPOBJ_VARIANT && local scope batch

LOCAL loPdfiumReport as PdfiumReport OF "..\Source\pdfium-vfp.vcx"
loPdfiumReport = NEWOBJECT("PdfiumReport", "pdfium-vfp.vcx", "../source/pdfiumreport.app", Thisform.Pdfium_env)
Expand All @@ -722,20 +722,18 @@ DEFINE CLASS sample AS form
REPORT FORM Report1.frx OBJECT loPdfiumReport
REPORT FORM Report2.frx OBJECT loPdfiumReport PREVIEW

loPdfiumReport.BatchEnd() && Mandatory. Release object or call BatchEnd to get the result of REPORT FORM PREVIEW OR REPORT FORM TO FILE
loPdfiumReport.BatchEnd()

loPdfiumReport = .F.

CASE 3 = REPOBJ_VARIANT && local scoped single
CASE 3 = REPOBJ_VARIANT && local scope single

LOCAL loPdfiumReport as PdfiumReport OF "..\Source\pdfium-vfp.vcx"
loPdfiumReport = NEWOBJECT("PdfiumReport", "pdfium-vfp.vcx", "../source/pdfiumreport.app", Thisform.Pdfium_env)

REPORT FORM Report1.frx OBJECT loPdfiumReport NOPAGEEJECT
REPORT FORM Report2.frx OBJECT loPdfiumReport PREVIEW

loPdfiumReport.BatchEnd() && Mandatory. Release object or call BatchEnd to get the result of REPORT FORM PREVIEW OR REPORT FORM TO FILE

loPdfiumReport = .F.


Expand Down
Binary file modified Sample/sample.sct
Binary file not shown.
Binary file modified Sample/sample.scx
Binary file not shown.
Binary file modified Source/PdfiumReport.PJT
Binary file not shown.
Binary file modified Source/PdfiumReport.pjx
Binary file not shown.
3 changes: 2 additions & 1 deletion Source/pdfium-vfp-dll/src/pdfium-vfp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ int WriteBlockCallback(FPDF_FILEWRITE* pFileWrite, const void* data, unsigned lo


//////////////////////////////////////////////////////////////////////////////////////////////
// origin: https://stackoverflow.com/a/77118485 by https://stackoverflow.com/users/15835974/jeremie-bergeron
// originated from https://stackoverflow.com/a/77118485 by https://stackoverflow.com/users/15835974/jeremie-bergeron
// with minor additions
//////////////////////////////////////////////////////////////////////////////////////////////
BOOL PDFIUM_VFP_CALL FPDF_GetFontFileName(WCHAR* family_name, BOOL is_bold, BOOL is_italic, DWORD nCharset, WCHAR* buffer, LONG buflen, DWRITE_FONT_SIMULATIONS* nFontSimulations, DWORD* bSymbolFont)
{
Expand Down
Loading

0 comments on commit 36a134c

Please sign in to comment.