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

Change PDF different orientation for one post. #85

Open
Feelosov opened this issue Mar 23, 2020 · 2 comments
Open

Change PDF different orientation for one post. #85

Feelosov opened this issue Mar 23, 2020 · 2 comments

Comments

@Feelosov
Copy link

Hi. This is best plugin of all. Can you do that: i change PDF orientation on fly for page posts? For example, i insert your short-code [dkpdf-pagebreak-horizontal] then [dkpdf-pagebreak-horizontal] then [dkpdf-pagebreak-vertical]

@Feelosov Feelosov changed the title Change PDF orientation for posts. Change PDF different orientation for one post. Mar 23, 2020
@Feelosov
Copy link
Author

As i see, its possible: https://mpdf.github.io/paging/page-breaks.html

Cit:

You can define or change all page characteristics when you add the new page:
orientation

@Feelosov
Copy link
Author

Feelosov commented Mar 23, 2020

Issue solved:
Add CSS into your file, for example:

@page horizontal {
size: landscape;
}
div.horizontal-pdf-orientation {
page: horizontal;
page-break-before: left;
}

and in your post add <div class="horizontal-pdf-orientation"></div> - after this DIV all pages in PDF will have horizontal orientation.

Some more - register a tiny shortcode:

function dkpdf_pagebreak_shortcode_horizontal( $atts, $content = null ) {
	$output = '<div class="horizontal-pdf-orientation"></div>';
	return $output;
}
add_shortcode( 'dkpdf-pagebreak-horizont', 'dkpdf_pagebreak_shortcode_horizontal' );

and use : [dkpdf-pagebreak-horizont]

So if you want vertical orientation after horizontal orientation , add new styles in your CSS for vertical.

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

No branches or pull requests

1 participant