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
Alban
2022-08-25 09:18:16 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
David PHAM-VAN
2022-08-25 07:37:19 -0300
Commit
d672bf7c351bcc364a585f12c42855ca51a191ba
d672bf7c
1 parent
161b10dc
fix: resolve driver compatibility issues
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
printing/windows/print_job.cpp
printing/windows/print_job.cpp
View file @
d672bf7
...
...
@@ -81,13 +81,21 @@ bool PrintJob::printPdf(const std::string& name,
bool
usePrinterSettings
)
{
documentName
=
name
;
auto
dm
=
static_cast
<
DEVMODE
*>
(
GlobalAlloc
(
0
,
sizeof
(
DEVMODE
)));
std
::
size_t
dmSize
=
sizeof
(
DEVMODE
);
std
::
size_t
dmExtra
=
0
;
if
(
!
printer
.
empty
()){
dmExtra
=
DeviceCapabilities
(
fromUtf8
(
printer
).
c_str
(),
NULL
,
DC_EXTRA
,
NULL
,
NULL
);
}
auto
dm
=
static_cast
<
DEVMODE
*>
(
GlobalAlloc
(
0
,
dmSize
+
dmExtra
));
if
(
usePrinterSettings
)
{
dm
=
nullptr
;
// to use default driver config
}
else
{
ZeroMemory
(
dm
,
sizeof
(
DEVMODE
));
dm
->
dmSize
=
sizeof
(
DEVMODE
);
dm
->
dmSize
=
(
WORD
)
dmSize
;
dm
->
dmDriverExtra
=
(
WORD
)
dmExtra
;
dm
->
dmFields
=
DM_ORIENTATION
|
DM_PAPERSIZE
|
DM_PAPERLENGTH
|
DM_PAPERWIDTH
;
dm
->
dmPaperSize
=
0
;
...
...
Please
register
or
login
to post a comment