Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2021-11-21 07:57:10 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3dd344bb67ede4cb455b700cd21588da8a246801
3dd344bb
1 parent
323a686c
Fix Windows print margins
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
printing/CHANGELOG.md
printing/linux/print_job.cc
printing/windows/print_job.cpp
printing/CHANGELOG.md
View file @
3dd344b
...
...
@@ -3,6 +3,7 @@
## 5.6.2
-
Fix Windows string encoding
-
Fix Windows print margins
## 5.6.2
...
...
printing/linux/print_job.cc
View file @
3dd344b
...
...
@@ -287,7 +287,8 @@ void print_job::raster_pdf(const uint8_t data[],
auto
bitmap
=
FPDFBitmap_Create
(
bWidth
,
bHeight
,
0
);
FPDFBitmap_FillRect
(
bitmap
,
0
,
0
,
bWidth
,
bHeight
,
0xffffffff
);
FPDF_RenderPageBitmap
(
bitmap
,
page
,
0
,
0
,
bWidth
,
bHeight
,
0
,
FPDF_ANNOT
);
FPDF_RenderPageBitmap
(
bitmap
,
page
,
0
,
0
,
bWidth
,
bHeight
,
0
,
FPDF_ANNOT
|
FPDF_LCD_TEXT
|
FPDF_NO_NATIVETEXT
);
uint8_t
*
p
=
static_cast
<
uint8_t
*>
(
FPDFBitmap_GetBuffer
(
bitmap
));
auto
stride
=
FPDFBitmap_GetStride
(
bitmap
);
...
...
printing/windows/print_job.cpp
View file @
3dd344b
...
...
@@ -218,6 +218,8 @@ void PrintJob::writeJob(std::vector<uint8_t> data) {
}
auto
pages
=
FPDF_GetPageCount
(
doc
);
auto
marginLeft
=
GetDeviceCaps
(
hDC
,
PHYSICALOFFSETX
);
auto
marginTop
=
GetDeviceCaps
(
hDC
,
PHYSICALOFFSETY
);
for
(
auto
pageNum
=
0
;
pageNum
<
pages
;
pageNum
++
)
{
r
=
StartPage
(
hDC
);
...
...
@@ -234,7 +236,8 @@ void PrintJob::writeJob(std::vector<uint8_t> data) {
int
bWidth
=
static_cast
<
int
>
(
pdfWidth
*
dpiX
);
int
bHeight
=
static_cast
<
int
>
(
pdfHeight
*
dpiY
);
FPDF_RenderPage
(
hDC
,
page
,
0
,
0
,
bWidth
,
bHeight
,
0
,
FPDF_ANNOT
);
FPDF_RenderPage
(
hDC
,
page
,
-
marginLeft
,
-
marginTop
,
bWidth
,
bHeight
,
0
,
FPDF_ANNOT
|
FPDF_PRINTING
);
FPDF_ClosePage
(
page
);
r
=
EndPage
(
hDC
);
}
...
...
Please
register
or
login
to post a comment