GithubHelp home page GithubHelp logo

simplepdf's People

Contributors

l-priebe avatar martinpfannemueller avatar mrichtsfeld avatar nrewik avatar ubernick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplepdf's Issues

Cell Background Color

I modified the code to add table cell background colors but wondered if a more official version would be released soon?

How to add multiple pages?

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.

Issue with compile errors

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?

How to begin new page automatically

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

Page Header/Footer

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.

Table extensions

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?

Support for macOS

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

Alignment of attributed string

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.

Table alignment is not working.

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)

Table

Hello, I was wondering is there any way to add table inside PDF?
I like your pod, good job!
Thanks in advance.

Alignments don't work in a table

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?

Support for merging multiple PDFs?

Are you planning to support for allow merging of multiple PDFs?

OR

Support for merging multiple instances and then create a single PDF file?

URL Error

when I use try? pdfData.write(to: path, options: .atomic) it gives me a URL error. Any easy ways to get around that? Thanks!

attributed text loses attributes...

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)

screen shot 2017-11-03 at 2 25 28 pm

I have tried several approaches as well as several images.

idea?

Architecture error

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.

Podspec platform

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"``?

CMYK support

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.

Adding checkboxes in PDF file

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"

How to add a digital signature field

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.