Skip to content

Conversation

@parthmshah1302
Copy link
Contributor

Enhancements to PDF Export Functionality:

  • freewrite/ContentView.swift: Added import statements for UniformTypeIdentifiers and PDFKit, and implemented a new exportEntryAsPDF function to allow exporting entries as PDFs. This includes creating a PDF from text, handling file names, and displaying a save dialog. [1] [2]
  • freewrite/ContentView.swift: Added a new state variable hoveredExportId and updated the UI to include an export button that appears on hover, alongside the existing trash icon. [1] [2]

Notes

  • Removed the findSubview code section because it was causing runtime errors when attempting to access and modify scroll views within the SwiftUI view hierarchy. This approach was encountering issues because it relies on internal implementation details that can change between OS versions. Since the app already uses the SwiftUI native .scrollIndicators(.never) modifier elsewhere in the code, this manual manipulation wasn't necessary for the functionality. The PDF export feature now works correctly with proper multi-page support, and the app's interface behavior remains consistent without these lines of code.
  • Removed the NSFont extension with defaultLineHeight() in favor of using the shared getLineHeight() function. This improves text layout consistency between screen display and PDF export while simplifying the codebase.

@parthmshah1302 parthmshah1302 marked this pull request as ready for review April 12, 2025 01:34
@parthmshah1302
Copy link
Contributor Author

parthmshah1302 commented Apr 12, 2025

pdf-freewrite-demo.mov

@farzaa
Copy link
Owner

farzaa commented Apr 12, 2025

fuck yessss. will run it tmmro + merge TY SO MUCH.

@yask123
Copy link

yask123 commented Apr 12, 2025

hmm why do we need export to pdf functionality?

Copy link

@quiint quiint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@farzaa
Copy link
Owner

farzaa commented Apr 14, 2025

hey @parthmshah1302 everything worked really well for me.

i made a few changes w/ my PRs on file name, and just button placement aesthetics.

Plz check and lmk and ill merge ty so much!!

@farzaa
Copy link
Owner

farzaa commented Apr 14, 2025

also you seem like you know what you're doing wanna help me w the rest of these PRs 😂

claude coded all this so idk if im fit to approve prs lol claude more qualified than me

@farzaa farzaa added the enhancement New feature or request label Apr 14, 2025
@farzaa
Copy link
Owner

farzaa commented Apr 14, 2025

yolo lets merge.

shipping in release rn <3. check in 15m.

also would love help w this if you can:

#27

@farzaa farzaa closed this Apr 14, 2025
@farzaa farzaa reopened this Apr 14, 2025
@farzaa farzaa merged commit 99e84a5 into farzaa:main Apr 14, 2025
@parthmshah1302
Copy link
Contributor Author

also you seem like you know what you're doing wanna help me w the rest of these PRs 😂

claude coded all this so idk if im fit to approve prs lol claude more qualified than me

yes sir - i would love to help more. taking a look, starting with #27.
ty for merging 🚀

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants