Age | Commit message (Collapse) | Author |
|
Return encryption dictionary as const reference
from CPDF_Parser.
Create a copy in CPDF_Creator if needed.
Change-Id: I270f71d307d818fba7f65ebe379f5942ae816934
Reviewed-on: https://pdfium-review.googlesource.com/38390
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Change-Id: I2927ebdf0aff31193ad69dcd5542f3858ffdd6ee
Reviewed-on: https://pdfium-review.googlesource.com/37790
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Improve CPDF_Document interface.
Fix relationship between CPDF_Document and CPDF_Parser.
This CL changes CPDF_Document to internally create the CPDF_Parser
and removes the need for the CPDF_Parser to know about the CPDF_Document.
Change-Id: Iec7aef19575c90f30b9a6c919dfd4f4417e4caf2
Reviewed-on: https://pdfium-review.googlesource.com/35630
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Now that there is a consistent underlying page type, we can unify these
actions.
Change-Id: I13fdfe775c540baaa0cd8085f8a7999fa6a3d276
Reviewed-on: https://pdfium-review.googlesource.com/34970
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
So remove the argument, and the logic dependent upon it being otherwise.
Rename function to more accurately reflect its purpose. Remove needless
null check while we're at it.
Change-Id: I7e119429fd159334eabcc250b5dac215580882ea
Reviewed-on: https://pdfium-review.googlesource.com/34950
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Make LoadDocumentImpl() logic match FPDFAvail_GetDocument() logic, so
that the XFA extension is loaded before checking unsupported features.
Add some comments along the way.
Change-Id: I040e40fcca872f7c0a46e921bce1146f0fe42588
Reviewed-on: https://pdfium-review.googlesource.com/34931
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This landed earlier as part of a larger change that got reverted for
unrelated reasons. Now re-land it by itself. See
https://pdfium-review.googlesource.com/c/pdfium/+/33370
If we don't have a document, then we can't dynamically tell if it is
an XFA doc, so there's no reason to believe it should have all permissions.
If there is an XFA doc under the covers, then the extension will give
us the value.
Change-Id: I6e007ab659914c39d2e5f3fe7a25d9d13439d358
Reviewed-on: https://pdfium-review.googlesource.com/34932
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Re-landing of https://pdfium-review.googlesource.com/c/pdfium/+/32892
This time, however, we do not build on the previous CL which cached
pages. This CL by itself should be OK but was reverted only because
it was blocking earlier reverts.
Change-Id: I067d5f07373eeac6cced5d0c113ea40e5f8dcd15
Reviewed-on: https://pdfium-review.googlesource.com/34910
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Only update state in CPDF_PageObjectHolder itself.
Make more data private.
Remove CPDF_Page::GetPageBBox() as exact duplicate of
CPDF_PageObjectHolder::GetBBox().
Change-Id: I083ec33f61a1490e7a5e673c9787751af15a6cd1
Reviewed-on: https://pdfium-review.googlesource.com/33810
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit f0d9d28a034fe3650c3c2d662090c1e8687ddb16.
Reason for revert: avoid parsing page.
Change-Id: Id3478f7e38f1cbe95d098e00158b1d7d9dc6f76e
Reviewed-on: https://pdfium-review.googlesource.com/33750
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit d06cc38b76685b002c51b227ae43b8314d926ad8.
Reason for revert: blocking previous revert
Change-Id: I74f8b80852c671440cca5fabef30e69cde9e2063
Reviewed-on: https://pdfium-review.googlesource.com/33713
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit d8126c2e72a60403c73f4187d4041364d45a8d61.
Reason for revert: Blocking previous revert.
Change-Id: I144841ad257401ab626b981ef7691d3b8003a49a
Reviewed-on: https://pdfium-review.googlesource.com/33711
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit 38cb7263a0923dd5613da24b18d3d7ef052ff5e3.
Reason for revert: Blocking prior revert.
Original change's description:
> Remove more ifndef XFA cases
>
> Remove FXFT_Clear_Face_External_Stream() calls, period. This would cause
> FT to try to free memory allocated by the caller, with potentially a
> different allocator. If we're leaking, msan will find it, and we can
> deal with it properly rather than trying to force FT to tidy after us.
>
> Always call SetView(), if we have a PDF page. At worst, the link won't
> be used in the XFA case.
>
> Always return 0 for the null document permissions. If we don't have a
> document, then we can't dynamically tell if its an XFA doc, so there's
> no reason to believe it should have all permissions. If there is an
> XFA doc under the covers, then the extension will give us the value.
>
>
> Change-Id: I6e3fb589eda722786567d96288cb35f43643437b
> Reviewed-on: https://pdfium-review.googlesource.com/33370
> Commit-Queue: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Lei Zhang <thestig@chromium.org>
TBR=thestig@chromium.org,tsepez@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I68b6a50ef28fb3d6ab9d8494c4486ca9fb66589e
Reviewed-on: https://pdfium-review.googlesource.com/33734
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit 0b4984ca4ed82023cd945512df5744eac394b53d.
Reason for revert: Blocking revert of
https://pdfium-review.googlesource.com/32830
Original change's description:
> Make FPDF_LoadPage return either page type at runtime.
>
> Rely on strict use of IPDF_Page::As*() methods to prevent bad downcasts.
>
> Change-Id: I92a146ffbe5d145ca4f4a5b8318f3599fd1d8431
> Reviewed-on: https://pdfium-review.googlesource.com/33431
> Reviewed-by: dsinclair <dsinclair@chromium.org>
> Commit-Queue: Tom Sepez <tsepez@chromium.org>
TBR=thestig@chromium.org,tsepez@chromium.org,dsinclair@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I6c8a6b87941d203245f7119bac13dd25b50db0ce
Reviewed-on: https://pdfium-review.googlesource.com/33731
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Remove FXFT_Clear_Face_External_Stream() calls, period. This would cause
FT to try to free memory allocated by the caller, with potentially a
different allocator. If we're leaking, msan will find it, and we can
deal with it properly rather than trying to force FT to tidy after us.
Always call SetView(), if we have a PDF page. At worst, the link won't
be used in the XFA case.
Always return 0 for the null document permissions. If we don't have a
document, then we can't dynamically tell if its an XFA doc, so there's
no reason to believe it should have all permissions. If there is an
XFA doc under the covers, then the extension will give us the value.
Change-Id: I6e3fb589eda722786567d96288cb35f43643437b
Reviewed-on: https://pdfium-review.googlesource.com/33370
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Rely on strict use of IPDF_Page::As*() methods to prevent bad downcasts.
Change-Id: I92a146ffbe5d145ca4f4a5b8318f3599fd1d8431
Reviewed-on: https://pdfium-review.googlesource.com/33431
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Create it explicitly as needed.
Change-Id: I42d5a6f33bc32e7fb768bed96aa6d239d133467e
Reviewed-on: https://pdfium-review.googlesource.com/33350
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Inverting the ownership from the current situation makes cleanup
much more intuitive.
Change-Id: Iad9a7ca70c0746170ba753297732e3e34f96c5ba
Reviewed-on: https://pdfium-review.googlesource.com/33190
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
|
|
Change-Id: I4c51bed2d285060f28311a0c5e1be9a7e19d408d
Reviewed-on: https://pdfium-review.googlesource.com/33153
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Now that both are ref-counted, we can replace ifdef's with some
polymorphism.
Bug: pdfium:760
Change-Id: Ie22ea259c9af56fa569f0af268b8e7065789a3f2
Reviewed-on: https://pdfium-review.googlesource.com/32892
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
We cache pages not by page number, which can bounce around as pages
are inserted or removed, but by page dictionary's object number.
Since the page may be created under one function and used under
another, we can't take the shortcut of not instantiating a render
cache nor not parsing the page.
Change-Id: I9a325cda8b3141153544ac53e78a51a44e6b411a
Reviewed-on: https://pdfium-review.googlesource.com/32830
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Tidy some code encountered along the way in cpdfsdk_helpers.cpp
Remove one ifdef from xfa-only file.
Restore some option flag processing (probably wrong to remove).
Flip some #ifndef to #ifdef (#ifndef PDF_ENABLE_XFA is an
anti-pattern and should be treated with suspicion since XFA should
always be "additive").
Change-Id: I564a28401e20e6269c85ea610da8c96f8c8dd737
Reviewed-on: https://pdfium-review.googlesource.com/32834
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Small step to reducing the differences between XFA and non-XFA. We
still use the RetainPtr pretty much as if it were an unique_ptr, in
that we're not yet caching pages and handing out multiple pointers
to the same page in the non-XFA case.
The one change is in page view cleanup, where we no longer need a
boolean and can take (sufficient) page ownership with a RetainPtr.
Tidy up some document.h -> page.h -> document.h circular inclusion
while we're at it.
NOTE: Wait for imminent branch to pass before landing. We'll want
this to bake a while.
Change-Id: I64a2f12ac3424ece1063d40583995b834117cf34
Reviewed-on: https://pdfium-review.googlesource.com/32790
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Work up the short call stack and mark FPDF_PAGERANGE as an opaque const
pointer. Also fix CPDF_ViewerPreferences::GenericName() to return an
optional string.
Change-Id: I2356d38888fcff8d4da37dd3efc17b284ff90485
Reviewed-on: https://pdfium-review.googlesource.com/32174
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
After getting a FPDF_PAGERANGE from FPDF_VIEWERREF_GetPrintPageRange(),
one can now use FPDF_VIEWERREF_GetPrintPageRangeCount() to get the
number of elements in the FPDF_PAGERANGE. One can then use
FPDF_VIEWERREF_GetPrintPageRangeElement() to read the elements.
Change-Id: I33eeff9026d01991ae1424e05b67f163245a35f9
Reviewed-on: https://pdfium-review.googlesource.com/32173
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Avoids a conflict should we wish to have the document actually
track pages, with a GetPage() that returns CPDF_Page.
Do the same thing to CPDF_DataAvail along the way.
Add some missing consts as well.
Change-Id: I2cb2213cc4c0649662fceab80407ee4a3f4cf30e
Reviewed-on: https://pdfium-review.googlesource.com/32158
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Id31b9f6ac33971c47cdb378ff7f9ca7d33f899b9
Reviewed-on: https://pdfium-review.googlesource.com/32112
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Diagnostic for the associated bug, not a bugfix. Helps rule out one
possible scenario.
Bug: chromium:838886
Change-Id: Ia56fda779407daf8e52a8b754800154fd7491ae7
Reviewed-on: https://pdfium-review.googlesource.com/32055
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Rather than messing with actual inheritence, add type-checking wrappers
and just blatantly cast to incomplete types. Along the way, this points
out places where we would downcast without checking, which I fix.
Change-Id: Ieb303eb46ad8522dfe082454f1f10f247ffd52d5
Reviewed-on: https://pdfium-review.googlesource.com/32030
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Another virtual API at the CPDF layer, to avoid a compile time
ifdef XFA.
Change-Id: Ia95c4d3b3d3b773aaf45c49ebcadff6b16ca18c6
Reviewed-on: https://pdfium-review.googlesource.com/31910
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Use strict typing for FPDF_Page to ensure we don't fall into
code that expects the other page type when continuing from null
context case.
Change-Id: I7f028ef3e3d733f5557620030a87e22997da00d5
Reviewed-on: https://pdfium-review.googlesource.com/31770
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Greatly minimize the impact between going back and forth from
XFA being on/off, so that XFA case is just an extension beyond
the non-XFA data structures we've shipped for years, instead of
being a complete replacement of them.
Change-Id: I6c98206e0ec99ea443547a4931eba912b1764d54
Reviewed-on: https://pdfium-review.googlesource.com/31690
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ic62f1def8e043494c9fa6c08a937d7d872513567
Reviewed-on: https://pdfium-review.googlesource.com/31314
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The existing PostScript modes write data into EMF comments. This
satisfies Chromium's use case, but other embedders want to write data
out via ExtEscape() in PASSTHROUGH mode.
BUG=pdfium:1068
Change-Id: I998035e99fbb84b16dcd244b750b476cecc3bd22
Reviewed-on: https://pdfium-review.googlesource.com/31299
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
|
|
Move WindowsPrintMode assertion into CPSPrinterDriver.
Change-Id: I570076b43751e052c5396e89a6674b83a4ad1a1e
Reviewed-on: https://pdfium-review.googlesource.com/31298
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
CFX_DIBitmap::Create returns false upon failure, so the return value of
this method should be checked most of the time. This CL fixes the calls
from fpdf_view.cpp.
Bug: pdfium:983
Change-Id: I5782d2859c5b2a2e0c540b80510d7c98c01c04f3
Reviewed-on: https://pdfium-review.googlesource.com/30750
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Instead of taking two doubles. The doubles get casted to floats anyway.
Change-Id: Ie16dc60fa5d6412026a5fda08c8c64d4fa2d56c4
Reviewed-on: https://pdfium-review.googlesource.com/30410
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Do the same for FPDF_PageToDevice(). Clean up the internal
implementation as well.
Change-Id: Ia207bfa779d144cb9f0310e768750ab10e603b8f
Reviewed-on: https://pdfium-review.googlesource.com/17370
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Just like CPDFXFA_Page. Also mark the methods const.
Change-Id: I6717b4b61a29663780f45bf872f76fe8e671df75
Reviewed-on: https://pdfium-review.googlesource.com/30132
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Instead of many int in-parameters.
Change-Id: I58b493ac0155f6b45f52963c0f61159633d88e28
Reviewed-on: https://pdfium-review.googlesource.com/30056
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I079bc3bf1242fd28fdd51930d9deb6efa34d7509
Reviewed-on: https://pdfium-review.googlesource.com/30055
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
It currently takes const FX_RECT*, but the pointer is never nullptr.
Change-Id: I571e9e8dd04756bc4daa25a61a5af8d1f902914b
Reviewed-on: https://pdfium-review.googlesource.com/30052
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This experimental API has been superceded by FPDF_SetPrintMode().
Change-Id: I41f8efbb2f40edea60df55c36f7ee3743ac20839
Reviewed-on: https://pdfium-review.googlesource.com/29510
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL makes the fpdfsdk/fpdf* files to be consistently prefixed with
fpdf_ instead of randomly dropping the _.
Change-Id: I23e3c8a0831b56bcd17c788d9fe874b2ab8b24fc
Reviewed-on: https://pdfium-review.googlesource.com/29390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|