|
|
Thread Tools | Search this Thread |
10-08-2024, 04:06 AM | #1 |
Zealot
Posts: 118
Karma: 16268
Join Date: Apr 2020
Device: none
|
Anyway to Create Headers and Footers Such That They Can't Be Selected
Hi!
Often times I'll be copying across a pagebreaks in PDF. I generate headers and footers from the GUI, EPUB >> PDF, with this: <header style="justify-content: flex-end; color: gray; font-size: small;padding-top: 20px;"><div class="odd-page"><i>_SECTION_</i></div></header> <p style="text-align:center; color: gray; font-size: small"> _PAGENUM_</p> When you drag the select across the pagebreak you'll get all those details in the selection. Anyway to suppress that? Such that the headers and footers are NON-selectable? I've got PDF X-change editor, so if there are any tools there you can think of, that'd work, too. But, question is - in going from Epub to PDF - any way to set the headers and footers into the page so they can't be copied? Thanks! |
10-08-2024, 04:53 AM | #2 |
creator of calibre
Posts: 44,548
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No as far as I know there is no way to make text in a pdf not copyable, regardless of its location.
|
Advert | |
|
10-09-2024, 02:04 AM | #3 |
Zealot
Posts: 118
Karma: 16268
Join Date: Apr 2020
Device: none
|
Yep, yep! Roger that.
Are there any other formats you can think of that sort of get around this wee quirk of PDF? One idea that occurred to me was to sort of render the headings FIRST? And, then transform them into background images? I mean - that'd be a whole other step, for sure, in the conversion process EPUB >> PDF, but it would be sort of a sweet win. The thing about the headings is a pain - almost like having the filename you're working on appended to any copy and paste. The files I use are all loooooooong from, and many a time I've had to go fish out the information. Whenever I'm on a conceptual roll, it's always a huge sort of mental momentum breaker for me. Half the time I'll just leave them in to keep the any motion going - but that's even worse in a way - coming back to find something floating around in notes I've made that's only like half the author's name and a page number, or a sub-chapter title. What do you think? Does my switch to background image before rendering text in body of pages have any validity? And! THANK YOU for Calibre! RARE have so many owed so much to - one GUY! Calbre is the jam, Kovid. THANK YOU! )) |
10-09-2024, 03:06 AM | #4 |
creator of calibre
Posts: 44,548
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just use EPUB with a reader that displays section titles in the header or footer such as the calibre viewer.
|
10-09-2024, 11:14 AM | #5 |
Zealot
Posts: 118
Karma: 16268
Join Date: Apr 2020
Device: none
|
I need to use a PDF reader - actually one specific one for the research I'm doing.
Are there any plugins for Calibre that do anything similar EPUB >> PDF? Or, even, PDF >> PDF? Could it be added as a feature? Here's my thinking - once the headers are added at the GUI in Calibre's conversion - there's not really any upside to having them copy and pasteable. How does that sound? Sincerely, Ski |
Advert | |
|
10-09-2024, 11:48 AM | #6 |
creator of calibre
Posts: 44,548
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Not something I am interested in implementing, sorry.
|
10-09-2024, 12:12 PM | #7 | |
Well trained by Cats
Posts: 30,447
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Make your headers an Image |
|
10-10-2024, 01:51 AM | #8 |
Zealot
Posts: 118
Karma: 16268
Join Date: Apr 2020
Device: none
|
Hi, Kovid!
Yep, yep. Alright. Thanks for giving it a look. Hi, theducks! No, not DRM. A way to not have to go back every time you copy across where there's a page break and then not need to go back and excise out the headers and/or footers. So that, instead of Sides DJ and HE, and by the transverse Line FG distinguished into two halfs, the one DG of an intensely blue Colour, the other FE of an intensely red. And BACcab represents the Prism whose refracting Planes ABba and ACca meet in the Edge of the refracting Angle Aa. This Newton Optiks PROPOSITIONS. PROP. I. Theor. I. 19 Edge Aa being upward, is parallel both to the Horizon, and to the Parallel-Edges of the Paper DJ and HE, and the transverse Line FG is perpendicular to the Plane of the Window. And de represents the Image of the Paper seen by Refraction you'd get: Sides DJ and HE, and by the transverse Line FG distinguished into two halfs, the one DG of an intensely blue Colour, the other FE of an intensely red. And BACcab represents the Prism whose refracting Planes ABba and ACca meet in the Edge of the refracting Angle Aa. This Edge Aa being upward, is parallel both to the Horizon, and to the Parallel-Edges of the Paper DJ and HE, and the transverse Line FG is perpendicular to the Plane of the Window. And de represents the Image of the Paper seen by Refraction You wrote, MAKE YOUR HEADERS AN IMAGE That's what I was thinking of. Some way to get this step https://ibb.co/K0WFHfz to create itself as an image, or as being otherwise unselectable. |
10-10-2024, 04:45 AM | #9 |
JCL Punch-Card Collector
Posts: 58
Karma: 10
Join Date: Jun 2014
Location: Antarctica
Device: Aggressively Device Independent
|
If you don't care about anything that is in the headers and footers in the PDF, try cropping the page to omit them (there are lots of free/open-source editors out there that will crop the page — just don't use any Adobe product, they don't actually "crop" but "mask"). This might turn a 6x9 (printed size, US sizing) page to 6x8.25. Then, to be certain, run the cropped PDF through a PDF printer (to create a new PDF), and use that last PDF as the source for any later conversions/editing/whatever.
I've done this process with journal articles from Springer with about 80% success. It's been about 60% success with books, but it's a small sample size (and the fails were from OUP). The downside is that you'll lose page numbering, but that's actually easier to put back in later either manually (iteratively inserting a naming anchor) or with a regexp search-and-replace than it is to deal with textual headers/footers via regexp. |
10-10-2024, 06:08 AM | #10 |
want to learn what I want
Posts: 1,260
Karma: 6433040
Join Date: Sep 2020
Device: Calibre E-book viewer
|
I was able to somehow make this work, following theducks' suggestion, by using the Prince PDF Calibre plugin and the below custom style:
PHP Code:
https://gutenberg.net.au/epub-ebooks...%20Orwell.epub I couldn't figure out how to call the section name and page numbers in the svg, but perhaps Jellby over at the Prince plugin thread can give some insight. By using Code:
content: string(chaptertitle); content: counter(page) "/" counter(pages); Hope this helps! Last edited by Comfy.n; 10-10-2024 at 06:12 AM. |
10-10-2024, 11:41 AM | #11 |
Zealot
Posts: 118
Karma: 16268
Join Date: Apr 2020
Device: none
|
Hi, Comfy.n,
Yeah! Lookit' THAT: https://ibb.co/ykLxjwF So, sounds like a combination of the plugin and the code. Buddy, that is WICKED cool! Jaws! Yeah - I've done that with articles like that, too! In the end, I always found, as I got deeper and deeper along, that I NEEDED the headings - that they HAVE a use - just no use in them getting copied all the time, eh? This all looks promising!!! |
10-10-2024, 01:09 PM | #12 |
creator of calibre
Posts: 44,548
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Well you can do that in calibre as well without needing SVG by using the canvas element. Something like this for a header template
Code:
<header><canvas><script> canvas = document.currentScript.parentNode canvas.height = canvas.parentNode.scrollHeight canvas.width = 1400 ctx = canvas.getContext("2d"); ctx.font = (canvas.parentNode.scrollHeight / 2) + "px sans-serif" ctx.fillStyle = 'yellow'; ctx.fillRect(0, 0, canvas.width, canvas.height) ctx.fillStyle = 'black'; ctx.fillText("section: _SECTION_", 5, canvas.parentNode.scrollHeight / 2); Last edited by kovidgoyal; 10-10-2024 at 02:18 PM. |
10-10-2024, 08:49 PM | #13 |
want to learn what I want
Posts: 1,260
Karma: 6433040
Join Date: Sep 2020
Device: Calibre E-book viewer
|
For some reason I don't get the text to appear, even trying different values. I see only the yellow rectangle:
|
10-11-2024, 12:06 AM | #14 |
creator of calibre
Posts: 44,548
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Play with ctx.font and ctx.fillText lines maybe try setting the height manually rather than relying on parentNode.scrollheight
|
10-11-2024, 04:11 AM | #15 |
want to learn what I want
Posts: 1,260
Karma: 6433040
Join Date: Sep 2020
Device: Calibre E-book viewer
|
wheee, I got it.
going to post shortly |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Books with headers and footers? | gracie | ePub | 3 | 08-10-2012 09:04 AM |
Where is remove Headers/Footers? | Anarel | Calibre | 4 | 05-25-2011 05:36 PM |
Removing Headers and Footers Here's What I Did | allowingtoo | Workshop | 0 | 02-16-2011 09:46 PM |
Removing Headers/Footers Help? | Anarel | Workshop | 10 | 11-09-2010 01:53 PM |
page headers/footers | daesdaemar | Workshop | 20 | 12-12-2008 10:22 PM |