Skip to content

[Due for payment 2026-04-28] [$250] Rotate Button Missing for PDF Receipts #80043

Closed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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:

  1. Create or open an expense
  2. Upload a PDF receipt
  3. Open the receipt preview
  4. 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:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Recording.2259.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022013963209300551638
  • Upwork Job ID: 2013963209300551638
  • Last Price Increase: 2026-02-04
Issue OwnerCurrent Issue Owner: @eVoloshchak

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 20, 2026
  2. melvin-bot commented on Jan 20, 2026

    @melvin-bot

    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.

  3. MobileMage commented on Jan 20, 2026

    @MobileMage
    Contributor

    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 shouldShowRotateReceiptButton check in src/pages/media/AttachmentModalScreen/routes/TransactionReceiptModalContent.tsx at lines 238-247:

    const shouldShowRotateReceiptButton = 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:

    1. 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.

    2. 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
    3. 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.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 21, 2026
  5. changed the title [-]Rotate Button Missing for PDF Receipts[/-] [+][$250] Rotate Button Missing for PDF Receipts[/+] on Jan 21, 2026
  6. melvin-bot commented on Jan 21, 2026

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 21, 2026
  8. melvin-bot commented on Jan 21, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

  9. eVoloshchak commented on Jan 22, 2026

    @eVoloshchak
    Contributor

    @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!

  10. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    Triggered auto assignment to @lakchote, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  11. 83 remaining items

  12. 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
  13. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  14. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    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:

    • @eVoloshchak requires payment through NewDot Manual Requests
    • @pasyukevich requires payment (Needs manual offer from BZ)
  15. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    @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]

  16. eVoloshchak commented on Apr 23, 2026

    @eVoloshchak
    Contributor

    @lakchote, this shouldn't be closed just yet, PR was deployed to prod 2 days ago, this has a payment left (provided no regressions)

  17. eVoloshchak commented on May 3, 2026

    @eVoloshchak
    Contributor

    This was a feature request, so the checklist isn't needed in my opinion

    @mallenexpensify, could you help with the payment here please?

  18. mallenexpensify commented on May 4, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @eVoloshchak due $250 via NewDot

  19. JmillsExpensify commented on May 7, 2026

    @JmillsExpensify
    Contributor

    $250 approved for @eVoloshchak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions