Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
4f5cf9d1
Commit
4f5cf9d1
authored
Apr 21, 2016
by
Craig Watson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When exporting to PDF merger, make sure to scale PDF items on the page if necessary
parent
3440be5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
UBExportFullPDF.cpp
src/adaptors/UBExportFullPDF.cpp
+7
-2
No files found.
src/adaptors/UBExportFullPDF.cpp
View file @
4f5cf9d1
...
@@ -62,7 +62,7 @@ UBExportFullPDF::UBExportFullPDF(QObject *parent)
...
@@ -62,7 +62,7 @@ UBExportFullPDF::UBExportFullPDF(QObject *parent)
//need to calculate screen resolution
//need to calculate screen resolution
QDesktopWidget
*
desktop
=
UBApplication
::
desktop
();
QDesktopWidget
*
desktop
=
UBApplication
::
desktop
();
int
dpiCommon
=
(
desktop
->
physicalDpiX
()
+
desktop
->
physicalDpiY
())
/
2
;
int
dpiCommon
=
(
desktop
->
physicalDpiX
()
+
desktop
->
physicalDpiY
())
/
2
;
mScaleFactor
=
72.0
f
/
dpiCommon
;
mScaleFactor
=
72.0
f
/
dpiCommon
;
// 1pt = 1/72 inch
mSimpleExporter
=
new
UBExportPDF
();
mSimpleExporter
=
new
UBExportPDF
();
}
}
...
@@ -206,7 +206,12 @@ bool UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QS
...
@@ -206,7 +206,12 @@ bool UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QS
xPdfOffset
+=
(
xPdf
-
xAnnotation
)
*
scaleFactor
*
mScaleFactor
;
xPdfOffset
+=
(
xPdf
-
xAnnotation
)
*
scaleFactor
*
mScaleFactor
;
yPdfOffset
-=
(
yPdf
-
yAnnotation
)
*
scaleFactor
*
mScaleFactor
;
yPdfOffset
-=
(
yPdf
-
yAnnotation
)
*
scaleFactor
*
mScaleFactor
;
TransformationDescription
pdfTransform
(
xPdfOffset
,
yPdfOffset
,
scaleFactor
,
0
);
// If the PDF was scaled when added to the scene (e.g if it was loaded from a document with a different DPI
// than the current one), it should also be scaled here.
qreal
currentDpi
=
(
UBApplication
::
desktop
()
->
physicalDpiX
()
+
UBApplication
::
desktop
()
->
physicalDpiY
())
/
2
;
qreal
pdfScale
=
qreal
(
UBSettings
::
pageDpi
)
/
currentDpi
;
TransformationDescription
pdfTransform
(
xPdfOffset
,
yPdfOffset
,
scaleFactor
*
pdfScale
,
0
);
TransformationDescription
annotationTransform
(
xAnnotationsOffset
,
yAnnotationsOffset
,
1
,
0
);
TransformationDescription
annotationTransform
(
xAnnotationsOffset
,
yAnnotationsOffset
,
1
,
0
);
MergePageDescription
pageDescription
(
pageSize
.
width
()
*
mScaleFactor
,
MergePageDescription
pageDescription
(
pageSize
.
width
()
*
mScaleFactor
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment