Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First page got wrong positions #811

Closed
CrackerakiUA opened this issue Jan 5, 2017 · 5 comments
Closed

First page got wrong positions #811

CrackerakiUA opened this issue Jan 5, 2017 · 5 comments
Labels

Comments

@CrackerakiUA
Copy link

CrackerakiUA commented Jan 5, 2017

I have couple pages and only first one get those wrong height and width.
screenshot 2017-01-05 19 16 59
Any idea what can go wrong? My script for generate pdf.

var content = [];
for (var j = 0; j < pages.length; j++) {
    if(pages[j].dataUrl) content.push({
        image: pages[j].dataUrl,
        width: 891,
        height: 630
    });
}
var docDefinition = {
    pageSize: {
        width: 891,
        height: 630
    },
    pageOrientation: 'landscape',
    pageMargins: [ 0, 0, 0, 0 ],
    content: content
};
pdfMake.createPdf(docDefinition).open();
@liborm85
Copy link
Collaborator

liborm85 commented Jan 8, 2017

Definition for reproduce problem:

var dd = {
    pageSize: {
        width: 891,
        height: 630
    },
    pageOrientation: 'landscape',
    pageMargins: [ 0, 0, 0, 0 ],
    content: [
        {
            image: 'sampleImage.jpg',
            width: 891,
            height: 630
        },
        {
            image: 'sampleImage.jpg',
            width: 891,
            height: 630
        },
        {
            image: 'sampleImage.jpg',
            width: 891,
            height: 630
        }
    ]
};

@liborm85 liborm85 added the bug label Jan 8, 2017
@liborm85
Copy link
Collaborator

liborm85 commented Jan 8, 2017

If you use this page size it works:

    pageSize: {
        width: 630,
        height: 891
    }

@CrackerakiUA
Copy link
Author

CrackerakiUA commented Jan 8, 2017

Indeed working, but it's bug for sure. Thank you.

@AvaelKross
Copy link

AvaelKross commented Feb 10, 2017

Same issue with 0.1.25. Here is minimal test to verify this bug on http://pdfmake.org/playground.html

var dd = {
    pageOrientation: 'landscape',
    pageSize: {width: 600, height: 200},
	content: [
		'pdfmake (since it\'s based on pdfkit) supports JPEG and PNG format',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used',
		'If no width/height/fit is provided, image original size will be used'
	]
}

@liborm85
Copy link
Collaborator

Fixed by d781ccc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants