-
Notifications
You must be signed in to change notification settings - Fork 56
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
Export PDF or print support page option #998
Comments
any plan fix this problem? the exported A4 PDF font size too large to view especially for code part with little fonts. |
I was able to set page size and margins using CSS at the top of the document, e.g.: <style type="text/css">@page { size: letter; margin: 0.25in; }</style> I'm not sure what other options are supported, but this worked for me to get letter size paper with a usable margin. |
That's a great hack. That CSS can also be added to one of the CSS override files -- putting it in |
It seems not work on my side. |
I agree. Not knowing much about coding, I put it straight into the |
If this is the only custom CSS you're using, then your entire @page { size: letter; margin: 0.25in; } |
Thanks for your reply. Even if I do use "letter" there is no change. |
@abnerlee : any chance to give me some guidance on this? |
Are you saying that when you use Note that you should make the change in |
@asherber : thanks for your feedback. |
There does seem to be a minimum margin applied somewhere else in the export process, but I still find that 0.25in gives me slightly smaller margins than the default. If you set it to something bigger, like 2in, you'll definitely see that it has an effect. |
@asherber : yes, you are right, setting it to 2in does make a difference. I find the default minimum too wide: the user should be able to choose. |
The extra margin is probably on the |
@pjeby : thanks for the advice. Unfortunately I am not technical enough to take that route. As for "change your page margins to compensate": that does not work, as I described above. |
can't set margin too。 anyelse other way ? |
This issue troubled me quite a long time on my Mac. Nether @page Nor @media custom setting is worked for me. One day I found the PDF exported is affacted by default paper size setting of OSX Printers & Scanners. I customized a paper with 230 mm width, then the margins and font size of exporting PDF is very close to tpyora editor under github theme. Hope it works for you. |
add this into @media print {
#write{
max-width: 100%;
}
@page {
size: A4;
margin-left: 0;
margin-right: 0;
}
} |
@yantanglife Is there any update on this issue? I "just" want to export something that approximately looks the same as when I see it within Typora. |
An update. Having some
loading it via the |
This issue was opened almost 3 years ago, and here we are, still messing around with CSS to try to find a workaround. I wonder if Abner is ever going to tackle this properly. |
Was working with a coworker on this exact issue and it seems margins work perfectly for the windows Typora but not for mac. So there might be an inconsistency somewhere there. |
Any news on this? |
Debug mode (Help menu -> Enable Debugging, then right-click on the document and Inspect Element) suggests that Typora is using Safari for its rendering engine as of v0.9.9.35.2 on the Mac. Safari currently doesn't support CSS' Putting @zecevic-matej's solution in a file named |
This procedure by @yantanglife works for me on Linux by putting it in |
2021 is the year and this is still a problem ❓ |
Unfortunately, this does not help as it should be. :/ |
Same here. I'm on MacOS and all the solution above didn't work for me. When I export the PDF file the margin is still very large. |
Reporting success. -- I solved this via a combination of recommendations above and @abnerlee's support page link, the following successfully defines the right/left File saved to themes directory:
Whereas, the following (alone) in
hth. |
When using the export to PDF feature in Typora, it always exports using A4 Portrait, instead of using values in File > Page Setup. I don’t know if this was designed this way or it is not behaving correctly, but I think the normal practice in macOS apps is to use the Page Setup for exporting. I am using a workaround for now — first export to html, and then print the html to PDF from Safari. It would save some hassle if Typora could handle the page setup itself. Thanks!
The text was updated successfully, but these errors were encountered: