We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0c858f commit 8bb498cCopy full SHA for 8bb498c
app/src/main/java/swati4star/createpdf/util/CreatePdf.java
@@ -132,6 +132,10 @@ protected String doInBackground(String... params) {
132
133
Log.v("Stage 6", "Image path adding");
134
135
+ float pageWidth = document.getPageSize().getWidth() - (mMarginLeft + mMarginRight);
136
+ float pageHeight = document.getPageSize().getHeight() - (mMarginBottom + mMarginTop);
137
+ image.scaleToFit(pageWidth, pageHeight);
138
+
139
image.setAbsolutePosition(
140
(documentRect.getWidth() - image.getScaledWidth()) / 2,
141
(documentRect.getHeight() - image.getScaledHeight()) / 2);
0 commit comments