You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-04-28] [$250] Rotate Button Missing for PDF Receipts #80043
Version Number: 9.3.5-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@sakluger Slack conversation (hyperlinked to channel name): #Migrate
Action Performed:
Create or open an expense
Upload a PDF receipt
Open the receipt preview
Look for the Rotate option
Expected Result:
A Rotate button should be available for PDF receipts, similar to image receipts
Actual Result:
No rotate option is displayed for PDF receipts.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Please re-state the problem that we are trying to solve in this issue.
When viewing a PDF receipt in the receipt preview modal, there is no rotate button available. This functionality exists for image receipts but is intentionally disabled for PDF files.
What is the root cause of that problem?
The rotate button visibility is controlled by the shouldShowRotateReceiptButton check in src/pages/media/AttachmentModalScreen/routes/TransactionReceiptModalContent.tsx at lines 238-247:
constshouldShowRotateReceiptButton=useMemo(()=>shouldShowReplaceReceiptButton&&transaction&&hasReceiptSource(transaction)&&!isEReceipt&&!transaction?.receipt?.isTestDriveReceipt&&(receiptFilename ? Str.isImage(receiptFilename) : false),// <-- This line excludes PDFs[shouldShowReplaceReceiptButton,transaction,isEReceipt,receiptFilename],);
The check Str.isImage(receiptFilename) only returns true for image extensions (jpeg, jpg, gif, png, bmp, webp). PDF files with the .pdf extension are explicitly excluded.
This was intentional because the rotateReceipt callback (lines 190-236) uses cropOrRotateImage from src/libs/cropOrRotateImage/index.ts, which relies on expo-image-manipulator - a library that only works with image files, not PDFs.
What changes do you think we should make in order to solve the problem?
Use a library like pdf-lib to actually rotate the PDF pages and save the result. This would make rotation work consistently across all platforms and persist the rotation when the receipt is downloaded/shared.
The implementation would:
Add a new rotatePdf utility function in src/libs/rotatePdf.ts that uses pdf-lib to load the PDF, rotate all pages by the specified degrees, and return a new File object.
Modify TransactionReceiptModalContent.tsx to support PDF rotation:
Add an isPdf check alongside the existing isImage check at line 93
Modify shouldShowRotateReceiptButton (lines 238-247) to include PDFs: change Str.isImage(receiptFilename) to (Str.isImage(receiptFilename) || Str.isPDF(receiptFilename))
Modify rotateReceipt callback (lines 190-236) to handle PDFs by calling the new rotatePdf utility when isPdf is true, then updating the receipt with the rotated file using the existing setMoneyRequestReceipt or replaceReceipt functions
Add pdf-lib to package.json dependencies
What alternative solutions did you explore? (Optional)
Visual rotation only using CSS transforms or react-pdf's rotate prop: This would only work on web and wouldn't persist the rotation. The rotated PDF would still be upside down when downloaded or shared.
@annaweber830, rotating the viewport instead of the PDF itself is an interesting idea, but I think we have to rotate the PDF for real, it would be more work to track the rotation across devices (it has to sync across users too) and you have to be able to download a receipt pdf in the correct orientation
changed the title [-][$250] Rotate Button Missing for PDF Receipts[/-][+][Due for payment 2026-04-28] [$250] Rotate Button Missing for PDF Receipts[/+]on Apr 21, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.60-22 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@eVoloshchak The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Jan 20, 2026
Triggered auto assignment to @heyjennahay (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.MobileMage commentedon Jan 20, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When viewing a PDF receipt in the receipt preview modal, there is no rotate button available. This functionality exists for image receipts but is intentionally disabled for PDF files.
What is the root cause of that problem?
The rotate button visibility is controlled by the
shouldShowRotateReceiptButtoncheck insrc/pages/media/AttachmentModalScreen/routes/TransactionReceiptModalContent.tsxat lines 238-247:The check
Str.isImage(receiptFilename)only returnstruefor image extensions (jpeg, jpg, gif, png, bmp, webp). PDF files with the.pdfextension are explicitly excluded.This was intentional because the
rotateReceiptcallback (lines 190-236) usescropOrRotateImagefromsrc/libs/cropOrRotateImage/index.ts, which relies onexpo-image-manipulator- a library that only works with image files, not PDFs.What changes do you think we should make in order to solve the problem?
Use a library like
pdf-libto actually rotate the PDF pages and save the result. This would make rotation work consistently across all platforms and persist the rotation when the receipt is downloaded/shared.The implementation would:
Add a new
rotatePdfutility function insrc/libs/rotatePdf.tsthat usespdf-libto load the PDF, rotate all pages by the specified degrees, and return a new File object.Modify
TransactionReceiptModalContent.tsxto support PDF rotation:isPdfcheck alongside the existingisImagecheck at line 93shouldShowRotateReceiptButton(lines 238-247) to include PDFs: changeStr.isImage(receiptFilename)to(Str.isImage(receiptFilename) || Str.isPDF(receiptFilename))rotateReceiptcallback (lines 190-236) to handle PDFs by calling the newrotatePdfutility whenisPdfis true, then updating the receipt with the rotated file using the existingsetMoneyRequestReceiptorreplaceReceiptfunctionsAdd
pdf-libto package.json dependenciesWhat alternative solutions did you explore? (Optional)
Visual rotation only using CSS transforms or react-pdf's rotate prop: This would only work on web and wouldn't persist the rotation. The rotated PDF would still be upside down when downloaded or shared.
[-]Rotate Button Missing for PDF Receipts[/-][+][$250] Rotate Button Missing for PDF Receipts[/+]melvin-bot commentedon Jan 21, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022013963209300551638
melvin-bot commentedon Jan 21, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (
External)eVoloshchak commentedon Jan 22, 2026
@annaweber830, rotating the viewport instead of the PDF itself is an interesting idea, but I think we have to rotate the PDF for real, it would be more work to track the rotation across devices (it has to sync across users too) and you have to be able to download a receipt pdf in the correct orientation
@MobileMage's proposal looks good to me!
🎀👀🎀 C+ reviewed!
melvin-bot commentedon Jan 22, 2026
Triggered auto assignment to @lakchote, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
83 remaining items
[-][$250] Rotate Button Missing for PDF Receipts[/-][+][Due for payment 2026-04-28] [$250] Rotate Button Missing for PDF Receipts[/+]melvin-bot commentedon Apr 21, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 21, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.60-22 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-04-28. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 21, 2026
@eVoloshchak The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
eVoloshchak commentedon Apr 23, 2026
@lakchote, this shouldn't be closed just yet, PR was deployed to prod 2 days ago, this has a payment left (provided no regressions)
eVoloshchak commentedon May 3, 2026
This was a feature request, so the checklist isn't needed in my opinion
@mallenexpensify, could you help with the payment here please?
mallenexpensify commentedon May 4, 2026
Payment Summary
Contributor+: @eVoloshchak due $250 via NewDot
JmillsExpensify commentedon May 7, 2026
$250 approved for @eVoloshchak