class PDF::Core::Page
Constants
- InitialPageContent
Public Instance Methods
empty?()
click to toggle source
Returns whether the current page is empty based on tare content stream (i.e., no content has been written). Returns false if a page has not yet been created.
# File lib/asciidoctor/pdf/ext/pdf-core/page.rb, line 13 def empty? content.stream.filtered_stream == (@tare_content_stream ||= InitialPageContent) && document.page_number > 0 end
imported()
click to toggle source
Flags this page as imported.
# File lib/asciidoctor/pdf/ext/pdf-core/page.rb, line 19 def imported @imported_page = true end
Also aliased as: imported_page
reset_content()
click to toggle source
Reset the content of the page. Note that this method may leave behind an orphaned background image.
# File lib/asciidoctor/pdf/ext/pdf-core/page.rb, line 27 def reset_content return if content.stream.filtered_stream == InitialPageContent xobjects.clear ext_gstates.clear new_content = document.state.store[document.ref({})] new_content << 'q' << ?\n content.replace new_content @tare_content_stream = InitialPageContent nil end
tare_content_stream()
click to toggle source
Record the page’s current state as the tare content stream (i.e., empty, meaning no content has been written).
# File lib/asciidoctor/pdf/ext/pdf-core/page.rb, line 7 def tare_content_stream @tare_content_stream = content.stream.filtered_stream end