23 m_pAcc->LoadAllDataRaw();
25 bool bHasFilter = pStream->HasFilter();
26 if (bHasFilter && !bFlateEncode) {
27 auto pDestAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pStream);
28 pDestAcc->LoadAllDataFiltered();
30 m_Data = m_pAcc->GetSpan();
31 m_pClonedDict = ToDictionary(pStream->GetDict()->Clone());
32 m_pClonedDict->RemoveFor(
"Filter");
36 if (bHasFilter || !bFlateEncode) {
37 m_Data = m_pAcc->GetSpan();
38 m_pDict = pStream->GetDict();
39 DCHECK(!m_pClonedDict);
44 m_Data = FlateModule::Encode(m_pAcc->GetSpan());
45 m_pClonedDict = ToDictionary(pStream->GetDict()->Clone());
46 m_pClonedDict->SetNewFor<CPDF_Number>(
47 "Length", pdfium::base::checked_cast<
int>(GetSpan().size()));
48 m_pClonedDict->SetNewFor<CPDF_Name>(
"Filter",
"FlateDecode");
49 m_pClonedDict->RemoveFor(pdfium::stream::kDecodeParms);