Skip to content

PDFExternalDocument adds an empty page #247

@divyeshmakwana96

Description

@divyeshmakwana96

I recently tried the external pdf document api and it appears that it adds an empty page before.

   let document = PDFDocument(format: format)

    // meta data
    document.info.title = "Title"
    document.info.subject = "Subject"
    if let bundleName = Bundle.main.infoDictionary!["CFBundleName"] as? String  {
        document.info.author = bundleName
    }
    
    if let externalReportURL = Bundle.main.url(forResource: "Cover", withExtension: "pdf") {
        let coverDocument = PDFExternalDocument(url:externalReportURL, pages: 1)
        document.add(externalDocument: coverDocument)
    }
    
    let generator = PDFGenerator(document: document)
    try? generator.generateURL(filename: "report.pdf")

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions