Sha256: c8bc75bb023bc96f2ad4e649fb572483de4a0aa8e062c956539645bb2c9c90c3
Contents?: true
Size: 1.1 KB
Versions: 40
Compression:
Stored size: 1.1 KB
Contents
# frozen_string_literal: true class PDF::Core::Page InitialPageContent = %(q\n) # Record the page's current state as the tare content stream (i.e., empty, meaning no content has been written). def tare_content_stream @tare_content_stream = content.stream.filtered_stream end # 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. def empty? content.stream.filtered_stream == (@tare_content_stream ||= InitialPageContent) && document.page_number > 0 end # Flags this page as imported. # def imported @imported_page = true end alias imported_page imported # Reset the content of the page. # Note that this method may leave behind an orphaned background image. 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 end
Version data entries
40 entries across 40 versions & 1 rubygems