Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
testing.tools.fixup_pdf_template.TemplateProcessor Class Reference
+ Collaboration diagram for testing.tools.fixup_pdf_template.TemplateProcessor:

Public Member Functions

 __init__ (self)
 
 insert_xref_entry (self, object_number, generation_number)
 
 generate_xref_table (self)
 
 preprocess_line (self, line)
 
 process_line (self, line)
 

Public Attributes

 streamlen_state = StreamLenState.START
 
list streamlens = []
 
int offset = 0
 
int xref_offset = 0
 
int max_object_number = 0
 
dict objects = {}
 
str objects = self.XREF_REPLACEMENT_N % self.objects[i]
 
str streamlen_state = b'stream'):
 

Static Public Attributes

str HEADER_TOKEN = b'{{header}}'
 
str HEADER_REPLACEMENT = b'%PDF-1.7\n%\xa0\xf2\xa4\xf4'
 
str XREF_TOKEN = b'{{xref}}'
 
str XREF_REPLACEMENT = b'xref\n%d %d\n'
 
str XREF_REPLACEMENT_N = b'%010d %05d n \n'
 
str XREF_REPLACEMENT_F = b'0000000000 65535 f \n'
 
str TRAILER_TOKEN = b'{{trailer}}'
 
str TRAILER_REPLACEMENT = b'trailer <<\n /Root 1 0 R\n /Size %d\n>>'
 
str TRAILERSIZE_TOKEN = b'{{trailersize}}'
 
str TRAILERSIZE_REPLACEMENT = b'/Size %d'
 
str STARTXREF_TOKEN = b'{{startxref}}'
 
str STARTXREF_REPLACEMENT = b'startxref\n%d'
 
str STARTXREFOBJ_PATTERN = b'\{\{startxrefobj\s+(\d+)\s+(\d+)\}\}'
 
str OBJECT_PATTERN = b'\{\{object\s+(\d+)\s+(\d+)\}\}'
 
str OBJECT_REPLACEMENT = b'\g<1> \g<2> obj'
 
str STREAMLEN_TOKEN = b'{{streamlen}}'
 
str STREAMLEN_REPLACEMENT = b'/Length %d'
 

Detailed Description

Definition at line 47 of file fixup_pdf_template.py.

Constructor & Destructor Documentation

◆ __init__()

testing.tools.fixup_pdf_template.TemplateProcessor.__init__ ( self)

Definition at line 76 of file fixup_pdf_template.py.

Member Function Documentation

◆ generate_xref_table()

testing.tools.fixup_pdf_template.TemplateProcessor.generate_xref_table ( self)

Definition at line 88 of file fixup_pdf_template.py.

References testing.tools.fixup_pdf_template.TemplateProcessor.max_object_number, and testing.tools.fixup_pdf_template.TemplateProcessor.XREF_REPLACEMENT.

Referenced by testing.tools.fixup_pdf_template.TemplateProcessor.process_line().

+ Here is the caller graph for this function:

◆ insert_xref_entry()

testing.tools.fixup_pdf_template.TemplateProcessor.insert_xref_entry ( self,
object_number,
generation_number )

Definition at line 84 of file fixup_pdf_template.py.

References testing.tools.fixup_pdf_template.TemplateProcessor.max_object_number, CFXJSE_Engine::ResolveResult.objects, ObjectReferenceHash.objects, qdesigner_internal::MetaDataBase.objects(), qdesigner_internal::Selection.objects, QDesignerMetaDataBaseInterface.objects(), QmlIR::Document.objects, QQmlApplicationEnginePrivate.objects, QQmlEngineDebugClient.objects(), QQmlEngineDebugClientPrivate.objects, QQmlEngineDebugContextReference.objects, QQmlInstantiatorPrivate.objects, QQmlJS::Dom::Component.objects(), QQmlJSImporter::Import.objects, QRhiBuffer::NativeBuffer.objects, QTextDocumentPrivate.objects, testing.tools.fixup_pdf_template.TemplateProcessor.objects, CJBig2_BitStream.offset(), CmapEncodingRecord.offset, CommandBufferExecTrackedState.offset, CompletionContextStrings.offset(), CTiffContext.offset(), Dasher.offset, fxcodec::DecodeData.offset, HPack::BitIStream.offset, HPack::FieldLookupTable::SearchEntry.offset, HPack::PrefixTable.offset, Http2::FrameReader.offset, NameRecord.offset, Plane.offset, PosixZone.offset, ProceduralMeshSubset.offset, ProceduralMeshSubset.offset(), QAbstractFileEngine::MapExtensionOption.offset, QAbstractItemViewPrivate.offset(), QAudioHelperInternal::signedVersion< quint8 >.offset, QBsdFbScreen.offset, QCborParserError.offset, QColumnViewPrivate.offset, QCommonListViewBase.offset(), QContiguousCacheData.offset, QD3D11CommandBuffer::Command::Args.offset, QDateTimePrivate::ZoneState.offset, QDeclarativeGeocodeModel.offset, QDeclarativeGeocodeModel.offset(), QFFmpeg::AudioRenderer::BufferedDataWithOffset.offset, QFFmpeg::PositionWithOffset.offset, QGeoCodeReply.offset(), QGeoCodeReplyPrivate.offset, QGles2CommandBuffer::Command::Args.offset, QGles2UniformDescription.offset, QGraphicsDropShadowEffect.offset, QGraphicsDropShadowEffect.offset(), QGraphicsPixmapItem.offset(), QGraphicsPixmapItemPrivate.offset, QGraphicsSceneBspTree::Node.offset, QHashPrivate::Data< Node >::Bucket.offset(), QHashPrivate::Data< QHashPrivate::Node >::Bucket.offset(), QHashPrivate::Span< Node >.offset(), QHeaderView.offset(), QIcc::MlucTagRecord.offset, QIcc::TagEntry.offset, QIcc::TagTableEntry.offset, QImage.offset(), QImageData.offset, QJsonParseError.offset, QLinuxFbScreen.offset, QLocaleData::DataRange.offset, QMacPasteboard::Promise.offset, QMetalBufferData::BufferUpdate.offset, QMetalShaderResourceBindingsData::Stage::Buffer.offset, QmlIR::Binding.offset, QNtlmBuffer.offset, QOpenGLExtensionsPrivate.offset, QOpenGLTextureHelper.offset, QPanGesture.offset, QPanGesture.offset(), QPanGesturePrivate.offset, QPixmapDropShadowFilter.offset(), QPixmapDropShadowFilterPrivate.offset, QQmlChangeSet::ChangeData.offset, QQmlChangeSet::MoveKey.offset, QQmlJS::Dom::Token.offset, QQmlJS::SourceLocation.offset, QQmlListCompositor::iterator.offset, QQmlLSCompletion::QQmlLSCompletionPosition.offset(), QQmlSA::SourceLocation.offset(), QQmltcObjectCreationHelper.offset(), QQuick3DGeometry::Attribute.offset, QQuick3DGeometry.offset, QQuick3DGeometryPrivate::Subset.offset, QQuick3DInstancingBinaryFileHeader.offset, QQuickDrawerPrivate.offset, QQuickPathView.offset, QQuickPathView.offset(), QQuickPathViewPrivate.offset, QQuickScrollBarPrivate.offset, QQuickStyledTextImgTag.offset, QResourceFileEnginePrivate.offset, QRhiMetalData::BufferReadback.offset, QRhiResourceUpdateBatchPrivate::BufferOp.offset, QRhiShaderResourceBinding::Data::StorageBufferData.offset, QRhiShaderResourceBinding::Data::UniformBufferData.offset, QRhiVertexInputAttribute.offset(), QSGGuiThreadShaderEffectManager::ShaderInfo::Variable.offset, QShaderDescription::BlockVariable.offset, QSSGMesh::AssetMeshSubset.offset, QSSGMesh::Mesh::Lod.offset, QSSGMesh::Mesh::Subset.offset, QSSGMesh::Mesh::VertexBufferEntry.offset, QSSGMesh::MeshInternal::MeshOffsetTracker.offset(), QSSGMesh::MeshInternal::Subset.offset, QSSGMesh::RuntimeMeshData::Attribute.offset, QSSGMeshBVHNode.offset, QSSGPerFrameAllocator::FastAllocator.offset, QSSGRenderGeometry::Attribute.offset, QSSGRenderSubset::Lod.offset, QSSGRenderSubset.offset, QSSGRhiShaderUniform.offset, QSSGRhiShaderUniformArray.offset, QSSGShaderKeyPropertyBase.offset, QSvgAttributes.offset, QTimeZone::ShortData.offset, QTtfStream.offset(), QV4::Compiler::Context::SourceLocationTable::Entry.offset, QV4::Heap::Pointer< T, o >.offset, QV4::Heap::Pointer< QV4::Heap::InternalClass *, 0 >.offset, QV4::HeapValue< size_t >.offset, QV4::Lookup.offset, QV4::UnwindCode.offset, QV4::ValueArray< size_t >.offset, QVariant::PrivateShared.offset, QVkBuffer::DynamicUpdate.offset, QWaylandSurfacePrivate.offset, QWaylandXdgPopup.offset, QWaylandXdgPopup.offset(), QWaylandXdgPositionerData.offset, QWidgetPaintContext.offset, SharedImageHeader.offset, TableDirectory.offset, TableRecord.offset, testing.tools.fixup_pdf_template.TemplateProcessor.offset, and Token.offset.

Referenced by testing.tools.fixup_pdf_template.TemplateProcessor.process_line().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preprocess_line()

testing.tools.fixup_pdf_template.TemplateProcessor.preprocess_line ( self,
line )

Definition at line 97 of file fixup_pdf_template.py.

References append(), testing.tools.fixup_pdf_template.TemplateProcessor.streamlen_state, testing.tools.fixup_pdf_template.TemplateProcessor.STREAMLEN_TOKEN, and testing.tools.fixup_pdf_template.TemplateProcessor.streamlens.

+ Here is the call graph for this function:

◆ process_line()

testing.tools.fixup_pdf_template.TemplateProcessor.process_line ( self,
line )

Definition at line 115 of file fixup_pdf_template.py.

References testing.tools.fixup_pdf_template.TemplateProcessor.generate_xref_table(), testing.tools.fixup_pdf_template.TemplateProcessor.HEADER_REPLACEMENT, testing.tools.fixup_pdf_template.TemplateProcessor.HEADER_TOKEN, testing.tools.fixup_pdf_template.TemplateProcessor.insert_xref_entry(), testing.tools.fixup_pdf_template.TemplateProcessor.max_object_number, testing.tools.fixup_pdf_template.TemplateProcessor.OBJECT_PATTERN, testing.tools.fixup_pdf_template.TemplateProcessor.OBJECT_REPLACEMENT, CFXJSE_Engine::ResolveResult.objects, ObjectReferenceHash.objects, qdesigner_internal::MetaDataBase.objects(), qdesigner_internal::Selection.objects, QDesignerMetaDataBaseInterface.objects(), QmlIR::Document.objects, QQmlApplicationEnginePrivate.objects, QQmlEngineDebugClient.objects(), QQmlEngineDebugClientPrivate.objects, QQmlEngineDebugContextReference.objects, QQmlInstantiatorPrivate.objects, QQmlJS::Dom::Component.objects(), QQmlJSImporter::Import.objects, QRhiBuffer::NativeBuffer.objects, QTextDocumentPrivate.objects, testing.tools.fixup_pdf_template.TemplateProcessor.objects, CJBig2_BitStream.offset(), CmapEncodingRecord.offset, CommandBufferExecTrackedState.offset, CompletionContextStrings.offset(), CTiffContext.offset(), Dasher.offset, fxcodec::DecodeData.offset, HPack::BitIStream.offset, HPack::FieldLookupTable::SearchEntry.offset, HPack::PrefixTable.offset, Http2::FrameReader.offset, NameRecord.offset, Plane.offset, PosixZone.offset, ProceduralMeshSubset.offset, ProceduralMeshSubset.offset(), QAbstractFileEngine::MapExtensionOption.offset, QAbstractItemViewPrivate.offset(), QAudioHelperInternal::signedVersion< quint8 >.offset, QBsdFbScreen.offset, QCborParserError.offset, QColumnViewPrivate.offset, QCommonListViewBase.offset(), QContiguousCacheData.offset, QD3D11CommandBuffer::Command::Args.offset, QDateTimePrivate::ZoneState.offset, QDeclarativeGeocodeModel.offset, QDeclarativeGeocodeModel.offset(), QFFmpeg::AudioRenderer::BufferedDataWithOffset.offset, QFFmpeg::PositionWithOffset.offset, QGeoCodeReply.offset(), QGeoCodeReplyPrivate.offset, QGles2CommandBuffer::Command::Args.offset, QGles2UniformDescription.offset, QGraphicsDropShadowEffect.offset, QGraphicsDropShadowEffect.offset(), QGraphicsPixmapItem.offset(), QGraphicsPixmapItemPrivate.offset, QGraphicsSceneBspTree::Node.offset, QHashPrivate::Data< Node >::Bucket.offset(), QHashPrivate::Data< QHashPrivate::Node >::Bucket.offset(), QHashPrivate::Span< Node >.offset(), QHeaderView.offset(), QIcc::MlucTagRecord.offset, QIcc::TagEntry.offset, QIcc::TagTableEntry.offset, QImage.offset(), QImageData.offset, QJsonParseError.offset, QLinuxFbScreen.offset, QLocaleData::DataRange.offset, QMacPasteboard::Promise.offset, QMetalBufferData::BufferUpdate.offset, QMetalShaderResourceBindingsData::Stage::Buffer.offset, QmlIR::Binding.offset, QNtlmBuffer.offset, QOpenGLExtensionsPrivate.offset, QOpenGLTextureHelper.offset, QPanGesture.offset, QPanGesture.offset(), QPanGesturePrivate.offset, QPixmapDropShadowFilter.offset(), QPixmapDropShadowFilterPrivate.offset, QQmlChangeSet::ChangeData.offset, QQmlChangeSet::MoveKey.offset, QQmlJS::Dom::Token.offset, QQmlJS::SourceLocation.offset, QQmlListCompositor::iterator.offset, QQmlLSCompletion::QQmlLSCompletionPosition.offset(), QQmlSA::SourceLocation.offset(), QQmltcObjectCreationHelper.offset(), QQuick3DGeometry::Attribute.offset, QQuick3DGeometry.offset, QQuick3DGeometryPrivate::Subset.offset, QQuick3DInstancingBinaryFileHeader.offset, QQuickDrawerPrivate.offset, QQuickPathView.offset, QQuickPathView.offset(), QQuickPathViewPrivate.offset, QQuickScrollBarPrivate.offset, QQuickStyledTextImgTag.offset, QResourceFileEnginePrivate.offset, QRhiMetalData::BufferReadback.offset, QRhiResourceUpdateBatchPrivate::BufferOp.offset, QRhiShaderResourceBinding::Data::StorageBufferData.offset, QRhiShaderResourceBinding::Data::UniformBufferData.offset, QRhiVertexInputAttribute.offset(), QSGGuiThreadShaderEffectManager::ShaderInfo::Variable.offset, QShaderDescription::BlockVariable.offset, QSSGMesh::AssetMeshSubset.offset, QSSGMesh::Mesh::Lod.offset, QSSGMesh::Mesh::Subset.offset, QSSGMesh::Mesh::VertexBufferEntry.offset, QSSGMesh::MeshInternal::MeshOffsetTracker.offset(), QSSGMesh::MeshInternal::Subset.offset, QSSGMesh::RuntimeMeshData::Attribute.offset, QSSGMeshBVHNode.offset, QSSGPerFrameAllocator::FastAllocator.offset, QSSGRenderGeometry::Attribute.offset, QSSGRenderSubset::Lod.offset, QSSGRenderSubset.offset, QSSGRhiShaderUniform.offset, QSSGRhiShaderUniformArray.offset, QSSGShaderKeyPropertyBase.offset, QSvgAttributes.offset, QTimeZone::ShortData.offset, QTtfStream.offset(), QV4::Compiler::Context::SourceLocationTable::Entry.offset, QV4::Heap::Pointer< T, o >.offset, QV4::Heap::Pointer< QV4::Heap::InternalClass *, 0 >.offset, QV4::HeapValue< size_t >.offset, QV4::Lookup.offset, QV4::UnwindCode.offset, QV4::ValueArray< size_t >.offset, QVariant::PrivateShared.offset, QVkBuffer::DynamicUpdate.offset, QWaylandSurfacePrivate.offset, QWaylandXdgPopup.offset, QWaylandXdgPopup.offset(), QWaylandXdgPositionerData.offset, QWidgetPaintContext.offset, SharedImageHeader.offset, TableDirectory.offset, TableRecord.offset, testing.tools.fixup_pdf_template.TemplateProcessor.offset, Token.offset, testing.tools.fixup_pdf_template.TemplateProcessor.STARTXREF_REPLACEMENT, testing.tools.fixup_pdf_template.TemplateProcessor.STARTXREF_TOKEN, testing.tools.fixup_pdf_template.TemplateProcessor.STARTXREFOBJ_PATTERN, testing.tools.fixup_pdf_template.TemplateProcessor.STREAMLEN_REPLACEMENT, testing.tools.fixup_pdf_template.TemplateProcessor.STREAMLEN_TOKEN, testing.tools.fixup_pdf_template.TemplateProcessor.streamlens, testing.tools.fixup_pdf_template.TemplateProcessor.TRAILER_REPLACEMENT, testing.tools.fixup_pdf_template.TemplateProcessor.TRAILER_TOKEN, testing.tools.fixup_pdf_template.TemplateProcessor.TRAILERSIZE_REPLACEMENT, testing.tools.fixup_pdf_template.TemplateProcessor.TRAILERSIZE_TOKEN, testing.tools.fixup_pdf_template.TemplateProcessor.xref_offset, and testing.tools.fixup_pdf_template.TemplateProcessor.XREF_TOKEN.

+ Here is the call graph for this function:

Member Data Documentation

◆ HEADER_REPLACEMENT

str testing.tools.fixup_pdf_template.TemplateProcessor.HEADER_REPLACEMENT = b'%PDF-1.7\n%\xa0\xf2\xa4\xf4'
static

◆ HEADER_TOKEN

str testing.tools.fixup_pdf_template.TemplateProcessor.HEADER_TOKEN = b'{{header}}'
static

◆ max_object_number

◆ OBJECT_PATTERN

str testing.tools.fixup_pdf_template.TemplateProcessor.OBJECT_PATTERN = b'\{\{object\s+(\d+)\s+(\d+)\}\}'
static

◆ OBJECT_REPLACEMENT

str testing.tools.fixup_pdf_template.TemplateProcessor.OBJECT_REPLACEMENT = b'\g<1> \g<2> obj'
static

◆ objects [1/2]

dict testing.tools.fixup_pdf_template.TemplateProcessor.objects = {}

◆ objects [2/2]

str testing.tools.fixup_pdf_template.TemplateProcessor.objects = self.XREF_REPLACEMENT_N % self.objects[i]

◆ offset

int testing.tools.fixup_pdf_template.TemplateProcessor.offset = 0

◆ STARTXREF_REPLACEMENT

str testing.tools.fixup_pdf_template.TemplateProcessor.STARTXREF_REPLACEMENT = b'startxref\n%d'
static

◆ STARTXREF_TOKEN

str testing.tools.fixup_pdf_template.TemplateProcessor.STARTXREF_TOKEN = b'{{startxref}}'
static

◆ STARTXREFOBJ_PATTERN

str testing.tools.fixup_pdf_template.TemplateProcessor.STARTXREFOBJ_PATTERN = b'\{\{startxrefobj\s+(\d+)\s+(\d+)\}\}'
static

◆ STREAMLEN_REPLACEMENT

str testing.tools.fixup_pdf_template.TemplateProcessor.STREAMLEN_REPLACEMENT = b'/Length %d'
static

◆ streamlen_state [1/2]

str testing.tools.fixup_pdf_template.TemplateProcessor.streamlen_state = StreamLenState.START

◆ streamlen_state [2/2]

str testing.tools.fixup_pdf_template.TemplateProcessor.streamlen_state = b'stream'):

◆ STREAMLEN_TOKEN

str testing.tools.fixup_pdf_template.TemplateProcessor.STREAMLEN_TOKEN = b'{{streamlen}}'
static

◆ streamlens

list testing.tools.fixup_pdf_template.TemplateProcessor.streamlens = []

◆ TRAILER_REPLACEMENT

str testing.tools.fixup_pdf_template.TemplateProcessor.TRAILER_REPLACEMENT = b'trailer <<\n /Root 1 0 R\n /Size %d\n>>'
static

◆ TRAILER_TOKEN

str testing.tools.fixup_pdf_template.TemplateProcessor.TRAILER_TOKEN = b'{{trailer}}'
static

◆ TRAILERSIZE_REPLACEMENT

str testing.tools.fixup_pdf_template.TemplateProcessor.TRAILERSIZE_REPLACEMENT = b'/Size %d'
static

◆ TRAILERSIZE_TOKEN

str testing.tools.fixup_pdf_template.TemplateProcessor.TRAILERSIZE_TOKEN = b'{{trailersize}}'
static

◆ xref_offset

int testing.tools.fixup_pdf_template.TemplateProcessor.xref_offset = 0

◆ XREF_REPLACEMENT

str testing.tools.fixup_pdf_template.TemplateProcessor.XREF_REPLACEMENT = b'xref\n%d %d\n'
static

◆ XREF_REPLACEMENT_F

str testing.tools.fixup_pdf_template.TemplateProcessor.XREF_REPLACEMENT_F = b'0000000000 65535 f \n'
static

Definition at line 55 of file fixup_pdf_template.py.

◆ XREF_REPLACEMENT_N

str testing.tools.fixup_pdf_template.TemplateProcessor.XREF_REPLACEMENT_N = b'%010d %05d n \n'
static

Definition at line 54 of file fixup_pdf_template.py.

◆ XREF_TOKEN

str testing.tools.fixup_pdf_template.TemplateProcessor.XREF_TOKEN = b'{{xref}}'
static

The documentation for this class was generated from the following file: