Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Direct to File mode in Java - PDF not getting updated

$
0
0
Hi, I am working with large pdf files and need to use direct to file mode.

I am not able to add anything to the pdf file when i use following example code. What am I doing wrong?

I access the pdf file using FileInputStream. Create Pdf instance with it. 
Get sections. use section.addParagraph to add a text object to pdf. 
then use Pdf.close()

But my pdf does not get updated. 

Sample code -
FileInputStream inputStream = new FileInputStream("file path");

Pdf pdf123 = new Pdf(inputStream);

Section section =  pdf123.getSections().add();

Text text = new Text("This is new page");

section.addParagraph(text);

pdf123.close();

Also another forum link points to code which used 'BinaryFileStream' which apparently is removed from the latest distribution of Aspose.pdf. But the code did something like setCanWrite(true);

Is the 'can write' part missing when we use file input stream?

Thanks for any inputs.

Regards,
Ashwin

Viewing all articles
Browse latest Browse all 3131

Trending Articles