nrewik / simplepdf Goto Github PK
View Code? Open in Web Editor NEWCreate a simple PDF effortlessly. :smile:
License: MIT License
Create a simple PDF effortlessly. :smile:
License: MIT License
I modified the code to add table cell background colors but wondered if a more official version would be released soon?
In my application the contents are exceeds more then one page means it overlaps at bottom of the page so I want to add multiple pages dynamically but unable to do that, please help me to find out the scenario.
I added this to my project, but I m getting compile errors in SimplePDF.swift => drawtext
let attributes: [NSAttributedStringKey: Any] = [
.font: font,
.foregroundColor: textColor,
.paragraphStyle: paragraphStyle
]
Type 'NSString' has no member 'font'
let attributes: [NSAttributedStringKey: Any] = [
.foregroundColor: textColor,
.paragraphStyle: paraStyle,
.obliqueness: skew,
.font: font
]
Type 'NSString' has no member 'foregroundColor'
Any clues?
Any one can advise how to use this code?
Kindly Help me to increase size of image.
Hi there,
how can we determine page height according to content, basically i have define pagesize but unable to begin new page as data is overlapping in single page
can you help me out how can start new page automatically
Can this feature be implemented in the near future?
I think I could throw a weekend at it and ask for a pull request if needed.
Hi, first of all, great library.
I'm working a lot with tables and would like to make some extensions there.
First the content alignment is not taken into account for table which means text is always centered.
Second it would be great to pass attributed text to a table which give great flexibility in displaying.
If you don't mind I will implement this and create a PR?
I could really use this. Anyone else? Would it be possible or is it outside of the SimplePDF scope?
Since a pdf generation tool like SimplePDF is quite general, I thought if it might be possible to make it compatible with macOS, and not only iOS?
If I add the project to a macOS project, I get the following error.
The platform of the target `TARGET NAME` (macOS 10.10) is not compatible with `SimplePDF (3.0.0)`, which does not support `osx`.
How can I set a background for a page?
Is it possible to create password for the PDF File?
Can you please add carthage support. thanks
Is any nice template created by SimplePDF for people to download? It would be helpful for everybody and increase the number of user for SimplePDF.
I noticed attributed string does not take alignment into account. I put together a quick patch to add alignment to attributed string only if paragraph style is not present in the attributed string. Although I could see why this may be not a good idea and may not work in some cases...
Let me know if you'd be interested in this patch and I'll prepare a pull request.
I'd like the title of my pdf to be a larger font - is there any way to achieve this?
Hello man,
can you please provide a project sample?
In Pdf I have add lot of images, It displays vertically column vice but I want to add images horizontally row vice.
It is possible to add images in single row.?
How to add custom name for pdf file?
Please fix with,
**let getAlignment = { () -> ContentAlignment in
if let al = tableDefinition?.alignments{
if al.count > j{
return al[j]
}
}
return .left
}()**
drawTextInCell(frame, text: dataArray[i][j] as NSString, alignment: **getAlignment**, font: currentFont, textColor: currentTextColor)
Hello, I was wondering is there any way to add table inside PDF?
I like your pod, good job!
Thanks in advance.
Hi there and thank you for this great library.
I noticed that alignments don't work when creating tables. It is always aligned to the left. Trying center and right has no effect.
Just following the example from the main page:
let tableDef = TableDefinition(alignments: [.center, .right],
columnWidths: [200, 200],
fonts: [UIFont.systemFont(ofSize: 16), UIFont.systemFont(ofSize: 16)],
textColors: [UIColor.black, UIColor.blue])
let data = [["test1","test1"]]
pdf.addTable(data.count,
columnCount: 2,
rowHeight: 25,
tableLineWidth: 0, // this is taken from the definition
tableDefinition: tableDef,
dataArray: data)
I'm using 4.5.1 from cocoapods. Any ideas?
Are you planning to support for allow merging of multiple PDFs?
OR
Support for merging multiple instances and then create a single PDF file?
Im getting that error on line 161 CTFrameDraw(frameRef, currentContext)
when I use try? pdfData.write(to: path, options: .atomic) it gives me a URL error. Any easy ways to get around that? Thanks!
Hey. I try to have an image attached into the NSAttributedString but the image gets lost.
let typeDetails = NSMutableAttributedString()
let attachment = NSTextAttachment()
attachment.image = Img.checked
attachment.bounds = CGRect(x: 0, y: 0, width: 10, height: 10)
let attachmentStr = NSAttributedString(attachment: attachment)
typeDetails.append( NSAttributedString(string: ">>>>>") )
typeDetails.append(attachmentStr)
typeDetails.append( NSAttributedString(string: "<<<<<") )
pdf.addAttributedText(text: typeDetails)
I have tried several approaches as well as several images.
idea?
Not sure if this is related to this repository, but I'm getting an error: "Could not find module 'SimplePDF' for target 'arm64-apple-ios-simulator'; found x86_64-apple-ios-simulator, at: /Users/Owner/Library/Developer/Xcode/DerivedData/Bizzy_Books-elclaesdwnetyuhhuzftdvwifm/Index.noindex/Build/Products/Debug-iphonesimulator/SimplePDF/SimplePDF.framework/Modules/SimplePDF.swiftmodule.
I think my iMac running Xcode has Intel x86_64.
hi , i wanna use library for objective-c class but the new pod is using swift 2 ? i cant run with xcode 9
I am currently working on a project with a minimum platform target of iOS 8.0 and need to generate a PDF. I found this library and tried to install it via cocoapods and found that i was unable to do so because of the platform in your podspec is :ios, "9.0"
.
So, I just tried to add the file SimplePDF.swift
to the project and use it and found I was able to compile and use your library without problems.
Could you set your podspec's platform to `:ios, "8.0"``?
Is it possible to save PDF in CMYK color space using this library? Apple's PDFContext cannot do it and I need it for printing.
Can you support NSAttributedStringKey.strikethroughStyle
and NSTextAttachment
with UIImage when use addAttributedText
with NSAttributedString
.
It's not support now. Thank you ^ ^
Is there a way of adding checkboxes?
Also can I add a string and an image besides the string?
Something like:
Do you want to participate? "Image or checkbox here"
Is there a pdf.addDigitalSignatureField option? If not, is there any way to improvise this?
My app is programmatically generating a work contract for construction business owners to automatically email to their potential customer and have a field for customer to digitally sign, save, and return back via email.
Thanks!!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.