Приложение Flutter для подписи PDF-файлов работает неправильноIOS

Программируем под IOS
Ответить
Anonymous
 Приложение Flutter для подписи PDF-файлов работает неправильно

Сообщение Anonymous »


Well i am trying to create a flutter pdf signature app the issue i am facing is that when i export the signature drawn and place it on a certain point where the signature is required on the singature position but when i save it. The signature is not place on a right place.

Result Before saving the pdf looks like this.
Изображение


Result After saving the pdf looks like this.
Изображение


Below is the code for saving the pdf with signature. For saving the document i am using syncfusion flutter pdf package
Future saveEditedPdf( Uint8List signatureImage, File selectedPdf, int signaturePageNumber, double width, double height, Offset position) async { debugPrint("here1"); //Create a new PDF document. final PdfDocument document = PdfDocument(inputBytes: selectedPdf.readAsBytesSync()); debugPrint("here2"); //Get the existing PDF page. final PdfPage page = document.pages[signaturePageNumber]; debugPrint("here3"); //Load the image using PdfBitmap. final PdfBitmap image = PdfBitmap(signatureImage); debugPrint("here4"); double difference = height - 200; //Draw the image to the PDF page. page.graphics.drawImage( image, Rect.fromLTWH( position.dx + width, position.dy + height, width, height)); //Rect.fromLTWH(position.dx, position.dy, width, height) // Rect. fromPoints( // position, Offset(position.dx + height, position.dy + height),), debugPrint("here5"); //getting path Directory? appDirectory = await getExternalStorageDirectory(); debugPrint(appDirectory.toString()); // if(Platform.isIOS){ // appDirectory = getappli // } debugPrint("here6"); String filePath = '${appDirectory?.path}/${(path.basename(selectedPdf.path))}'; debugPrint("here7"); // Save the document. File(filePath).writeAsBytes(await document.save()); debugPrint("here8"); debugPrint("saved"); // Dispose the document. document.dispose(); return filePath; }

Источник: https://stackoverflow.com/questions/780 ... -correctly
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «IOS»