Migration from legacy Aspose.Pdf.Kit for Java with PdfFileEditor.insert

Hello,

I encounter
an issue when migrating from com.aspose.pdf.kit.PdfFileEditor
(aspose-pdf-kit-4.6.0.jar) to com.aspose.pdf.facades.PdfFileEditor
(aspose.pdf-new-4.0.0.jar) in the following method:

PdfFileEditor.insert(java.io.InputStreaminputStream,
intinsertLocation,

java.io.InputStreamportStream,

intstartPage,
intendPage,
java.io.OutputStreamoutputStream)

The file
generated through
OutputStreamoutputStream<span style=“mso-fareast-font-family:“Times New Roman”;mso-bidi-font-family:“Courier New”;
mso-ansi-language:EN-US;mso-fareast-language:FR” lang=“EN-US”> is empty (file size: zero) with
the new library aspose.pdf-new-4.0.0.jar

For comparison, please find
both java projects (using old and new library) to illustrate this issue.

Thank you
for your analysis.

Regards


Samuel VILLENEUVE

Sopra group.

samuel.villeneuve@sopragroup.com

Hi Samuel,


Sorry for the inconvenience faced. I’ve managed to reproduce
the reported issues on my side and logged the issue in our bug tracking system
for further investigation and resolution, the issue ID is
PDFNEWJAVA-33525.
I’ve also linked your request to this issue and you will be notified via this
forum thread as soon as it is resolved.


Please feel free to contact us for any further assistance.

Best Regards,

Hello,

Please, could you provide us a status on PDFNEWJAVA-33525?

Thank you.

Regards.

Hi Samuel,

The development team has been busy resolving other priority issues and I am afraid the above stated problem is not yet resolved. Nevertheless, I have requested the development team to share any possible ETA. As soon as I have some updates regarding its resolution, I would be more than happy to update you with the status of correction. Please be patient and spare us little time.

We are sorry for this delay and inconvenience.

Hello,

Do you have any update to provide me about this issue? Could you give me an estimated delivery date for the correction?

Thanks in advance for your reply

Best regards,
Thibaut Nicolas

Hi Thibaut,


Thanks for your patience.

I am pleased to share that the issue reported earlier as PDFNEWJAVA-33525 has been resolved and its resolution will be included in next release of Aspose.Pdf for Java 4.2.0 which is planned to release by the end of July-2013. As soon as the new version becomes available, we would be more than happy to update you with the status of correction. Please be patient and wait for new release.

Hello,

Do you have an estimated delivery date for Aspose.Pdf for Java 4.2.0 ?

Thanks you.

Regards,

Hi Samuel,


Thanks for your inquiry. Aspose.Pdf for Java 4.2.0 release was delayed due to some blocking issues. However, now we have planned this release in start of September, 2013. We will notify you via this forum thread, as soon as its released after successful testing,

We are sorry for any inconvenience.

Best Regards,

The issues you have found earlier (filed as PDFNEWJAVA-33525) have been fixed in Aspose.Pdf for Java 4.2.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hello,

Issue still
exists even when using Aspose.Pdf for java 4.2.0.

Thus, in some cases, the
file generated through OutputStreamoutputStream of PdfFileEditor.insert is still
empty (file size: zero).

It seems to
work when intendPage = 1 but not when intendPage > 1.

Please,
could you investigate further?

Thank you.

Regards

<!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tableau Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>

svilleneuve:
It seems to work when intendPage = 1 but not when intendPage > 1.

Hi Samuel,

Can you please share some details on how to replicate the above stated issue. I have tried setting the InsertLocation (second argument) greater than 1 and have also specified the number of pages to be inserted as greater than 1 (fifth argument) but I am unable to notice any issue. I have used the following code snippet to test the scenario.

Java

String myDir = "c:/pdftest/";
com.aspose.pdf.facades.PdfFileEditor pdfEditor = new com.aspose.pdf.facades.PdfFileEditor();

InputStream linkStreamFile = new FileInputStream(myDir + "2013-06-06_10h11m39s_02019-006434001_LINK_2013-04-10_11-47-12.png.intermediate.pdf");
//$NON-NLS-1$

InputStream tempInputStream = new FileInputStream(myDir + "2013-06-06_10h11m39s_02019-006434001_DocsIN_DocumentRtfGenere1.rtf.prepared.rtf.intermediate.pdf");
//$NON-NLS-1$

OutputStream tempOutputStream = new FileOutputStream(myDir + "2013-06-06_10h11m39s_02019-006434001_DocsIN_DocumentRtfGenere1.rtf.prepared.rtf.intermediate.pdf_assembly_link_1on1.final.pdf");
//$NON-NLS-1$

pdfEditor.insert(tempInputStream, 2,
linkStreamFile, 1, 2, tempOutputStream);

linkStreamFile.close();
tempInputStream.close();
tempOutputStream.close();

Hello,

Here are 6 test cases to reproduce the issue :
- Test #1 “Insertion of 4 pages on page #2 with intStartPage = 1” - OK
- Test #2 “Insertion of 5 pages on page #2 with intStartPage = 1” - NOK
- Test #3 “Insertion of 4 pages on page #3 with intStartPage = 2” - OK
- Test #4 “Insertion of 5 pages on page #3 with intStartPage = 2” - NOK
- Test #5 “Insertion of 4 pages on page #2 with intStartPage = 2” - OK
- Test #6 “Insertion of 5 pages on page #2 with intStartPage = 2” - NOK

Considerate following:
- Input file “Input.pdf” used for the first parameter “tempInputStream” contains a total of 3 pages,
- File to be inserted “link_to_be_inserted.pdf” used for the third parameter “
linkStreamFile” contains a total of 6 pages,
- Output file for each Test Case is named as following : "Output.pdf"

Find in attachment java project with PDF files.

Please, let us known your analysis.
Thank you.

Regards.

svilleneuve:
Here are 6 test cases to reproduce the issue :
- Test #1 “Insertion of 4 pages on page #2 with intStartPage = 1” - OK
- Test #2 “Insertion of 5 pages on page #2 with intStartPage = 1” - NOK
- Test #3 “Insertion of 4 pages on page #3 with intStartPage = 2” - OK
- Test #4 “Insertion of 5 pages on page #3 with intStartPage = 2” - NOK
- Test #5 “Insertion of 4 pages on page #2 with intStartPage = 2” - OK
- Test #6 “Insertion of 5 pages on page #2 with intStartPage = 2” - NOK

Considerate following:
- Input file “Input.pdf” used for the first parameter “tempInputStream” contains a total of 3 pages,
- File to be inserted “link_to_be_inserted.pdf” used for the third parameter “
linkStreamFile” contains a total of 6 pages,
- Output file for each Test Case is named as following : "Output.pdf
Hi Samuel,

I have tested the above stated scenario and I am able to
reproduce the same problem. For the sake of correction, I have logged this issue
as PDFNEWJAVA-33716 in our issue tracking system. We will
further look into the details of this problem and will keep you updated on the
status of correction. Please be patient and spare us little time. We are sorry
for this inconvenience.

Hello,

Do you have an ETA for correction of PDFNEWJAVA-33716 ?

Thanks you.

Regards,

Hi Samuel,


Thanks for your patience.

Initially the issue was logged under Normal support model but recently the priority of this issue has been raised to Enterprise Support. The development team is working on fixing this problem on priority basis and as soon we have some further updates, we would be more than happy to update you with the status of correction.

Nevertheless, I have also inquired the ETA from development team regarding the resolution of this problem. Soon you will be provided with the required information.
svilleneuve:
Do you have an ETA for correction of PDFNEWJAVA-33716 ?
Hi Samuel,

Thanks for your patience.

As per our current estimates, we plan to get this issue resolved within current month. As soon as we have some further updates, we would be more than happy to update you with the status of correction.

Your patience and comprehension is greatly appreciated in this regard.

Hi Samuel,


Thanks for your patience.

I just have got an intimation from development team that the problem PDFNEWJAVA-33716 reported earlier is resolved and its fix will be included in next release of Aspose.Pdf for Java 4.3.0. As soon as the new version becomes available, we would be more than happy to update you with the status of availability.

The issues you have found earlier (filed as PDFNEWJAVA-33716) have been fixed in Aspose.Pdf for Java 4.3.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.