문제

So, I've got a document:

var doc = new PDFDocument;

The docs tells me that The first page of a PDFKit document is added for you automatically, so there's no need to add it manualy. But how can I meke it to be landscape?

This one

doc.addPage({
    size: 'LEGAL',
    layout: 'landscape'
});

works, but adds another page.

도움이 되었습니까?

해결책

So it was quite obvious:

var doc = new PDFDocument(
        {
            layout : 'landscape'
        }
    );

다른 팁

You can disable autoFirstPage

const doc = new PDFDocument({ autoFirstPage: false });
doc.addPage({
    size: 'LEGAL',
    layout: 'landscape'
});

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top