|
@@ -18,6 +18,8 @@
|
|
|
#include "Trace.h"
|
|
|
#include <windows.h>
|
|
|
#include <winnt.h>
|
|
|
+#include "PDFModifiedPage.h"
|
|
|
+#include "AbstractContentContext.h"
|
|
|
int main(){
|
|
|
//
|
|
|
// Go to: "%AppData%\..\Local\VirtualStore" - because Windows does not write to the C:\ drive
|
|
@@ -65,10 +67,11 @@ int main(){
|
|
|
pageContentContext->ET();
|
|
|
pdfWriter.EndPageContentContext(pageContentContext);
|
|
|
pdfWriter.WritePageAndRelease(pdfPage);
|
|
|
+ pdfWriter.EndPDF();
|
|
|
// ****************Shutdown Usage************
|
|
|
// ******************************************
|
|
|
// ******************************************
|
|
|
- pdfWriter.Shutdown("c:\\myFile.pdf.shutdown");
|
|
|
+ // pdfWriter.Shutdown("c:\\myFile.pdf.shutdown");
|
|
|
/*PDFWriter pdfWriterB;
|
|
|
pdfWriterB.ContinuePDF("c:\\myFile.pdf","myFile.pdf.shutdown","",LogConfiguration(true,true,".\\logMe"));
|
|
|
PDFPage* pdfPageB = new PDFPage();
|
|
@@ -94,25 +97,34 @@ int main(){
|
|
|
}
|
|
|
pdfWriterB.EndPDF();*/
|
|
|
|
|
|
- PDFWriter pdfWriterB;
|
|
|
- pdfWriterB.ContinuePDF("C:\\Users\\bad-p\\AppData\\Local\\VirtualStore\\myFile.pdf","C:\\Users\\bad-p\\AppData\\Local\\VirtualStore\\myFile.pdf.shutdown");
|
|
|
+ // PDFWriter pdfWriterB;
|
|
|
+ //pdfWriterB.StartPDF("c:\\myFile.pdf",ePDFVersion13,LogConfiguration(true,true,".\\logMe"));
|
|
|
+ //pdfWriterB.ContinuePDF("C:\\Users\\bad-p\\AppData\\Local\\VirtualStore\\myFile.pdf","C:\\Users\\bad-p\\AppData\\Local\\VirtualStore\\myFile.pdf.shutdown");
|
|
|
// Create a new page
|
|
|
- PDFPage* pdfPage2 = new PDFPage();
|
|
|
- pdfPage2->SetMediaBox(PDFRectangle(0,0,595,842));
|
|
|
- // Create a content context for the page
|
|
|
- PageContentContext* pageContentContext2 = pdfWriterB.StartPageContentContext(pdfPage2);
|
|
|
- PDFFormXObject* image = pdfWriterB.CreateFormXObjectFromJPGFile("C:\\Users\\bad-p\\Desktop\\Work Folder\\VS CODE\\SanAntonioPass.jpg");
|
|
|
+ pdfWriter.ModifyPDF("c:\\myFile.pdf",ePDFVersion13,"", LogConfiguration(true,true,".\\logMe"));
|
|
|
+ PDFModifiedPage pdfPage2(&pdfWriter,0);
|
|
|
+ AbstractContentContext* contentContext = pdfPage2.StartContentContext();
|
|
|
+ PDFFormXObject* image = pdfWriter.CreateFormXObjectFromJPGFile("C:\\Users\\bad-p\\Desktop\\Work Folder\\VS CODE\\SanAntonioPass.jpg");
|
|
|
if (!image){
|
|
|
TRACE_LOG("Image file not found, creating PDF without image.");
|
|
|
printf("The image \"C:\\Users\\bad-p\\Desktop\\Work Folder\\VS CODE\\SanAntonioPass.jpg\" was not found.");
|
|
|
}
|
|
|
- pageContentContext2->q();
|
|
|
- pageContentContext2->cm(0.4,0,0,0.4,57.5,241);
|
|
|
- pageContentContext2->Do(pdfPage2->GetResourcesDictionary().AddFormXObjectMapping(image->GetObjectID()));
|
|
|
- pageContentContext2->Q();
|
|
|
- delete image;
|
|
|
+ contentContext->q();
|
|
|
+ contentContext->cm(0.4,0,0,0.4,57.5,241);
|
|
|
+ contentContext->Do("oooogAAABooogggAAABoogggaaa");
|
|
|
+ //contentContext->Do(pdfPage2->GetResourcesDictionary().AddFormXObjectMapping(image->GetObjectID()));
|
|
|
+ contentContext->Q();
|
|
|
+ delete image;
|
|
|
+ //AbstractContentContext::TextOptions opt(pdfWriter.GetFontForFile("C:\\Windows\\Fonts\\arial.ttf"),14,AbstractContentContext::eGray,0);
|
|
|
+ //contentContext->WriteText(75,805,"Test Text",opt);
|
|
|
+ pdfPage2.EndContentContext();
|
|
|
+ pdfPage2.WritePage();
|
|
|
+ /*pdfPage2->SetMediaBox(PDFRectangle(0,0,595,842));
|
|
|
+ // Create a content context for the page
|
|
|
+ PageContentContext* pageContentContext2 = pdfWriter.StartPageContentContext(pdfPage2);
|
|
|
+
|
|
|
// End content context, and write the page
|
|
|
- pdfWriterB.EndPageContentContext(pageContentContext2);
|
|
|
- pdfWriterB.WritePageAndRelease(pdfPage2);
|
|
|
- pdfWriterB.EndPDF();
|
|
|
+ pdfWriter.EndPageContentContext(pageContentContext2);
|
|
|
+ pdfWriter.WritePageAndRelease(pdfPage2);*/
|
|
|
+ pdfWriter.EndPDF();
|
|
|
}
|