Giter Club home page Giter Club logo

Comments (4)

galkahana avatar galkahana commented on July 20, 2024

Hi Lidia,
The PageModifier adds new content on top of the existing page content.
When using it then you should be aware that I recently added another flag to its constructor which you should probably use. like this:

PDFModifiedPage modifiedPage(&pdfWriter,0,true);

It encapsulates the existing content with save..restore, so what content you add is not affected by non encapsulated settings of the existing content, such as a transformation matrix.

Regards,
Gal.

from pdf-writer.

Lidia321 avatar Lidia321 commented on July 20, 2024

Hi again, Gal.

This is what I thought too :).

Unfortunatelly, it does not work. My guess this is probably some bug with specific pdf that is attached.
AMERICAN FOOTBALL.PDF

Code is taken from example you've provided in
https://github.com/galkahana/PDF-Writer/blob/master/PDFWriterTestPlayground/PageModifierTest.cpp

Could you advice, please ?

Thanks and cheers.
Lidia.

void main()
{

EStatusCode status = eSuccess;
PDFWriter pdfWriter;

do
{


    // open file for modification
    status = pdfWriter.ModifyPDF(
        "AMERICAN FOOTBALL.PDF",
        ePDFVersion13,
        "outout.pdf");


    PDFModifiedPage modifiedPage(&pdfWriter, 0, true);

    AbstractContentContext* contentContext = modifiedPage.StartContentContext();

    AbstractContentContext::TextOptions opt(
        pdfWriter.GetFontForFile("PDFHummus\\TestMaterials\\fonts\\arial.ttf"),
                                                                        14,
                                                                        AbstractContentContext::eGray,
                                                                                               0
        );

    contentContext->WriteText(75,805,"Test Text",opt);

    modifiedPage.EndContentContext();
    modifiedPage.WritePage();

    status = pdfWriter.EndPDF();

} while (false);

}

from pdf-writer.

galkahana avatar galkahana commented on July 20, 2024

Yap.
Had a problem there with one method to write contents to a page.

fixed it now in latest commit.

from pdf-writer.

Lidia321 avatar Lidia321 commented on July 20, 2024

It works - thanks a lot for quick fix.

Cheers.
Lidia.

from pdf-writer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.