You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Michael Benoit (Created) (JIRA)" <xm...@xml.apache.org> on 2012/01/06 22:00:40 UTC

[jira] [Created] (XMLBEANS-475) Adding image using XSSF with previous images corrupts the entire file

Adding image using XSSF with previous images corrupts the entire file
---------------------------------------------------------------------

                 Key: XMLBEANS-475
                 URL: https://issues.apache.org/jira/browse/XMLBEANS-475
             Project: XMLBeans
          Issue Type: Bug
    Affects Versions:  Version 2.3
         Environment: Windows 7, eclipse, java 1.6
            Reporter: Michael Benoit


When I try to add images to an xlsx file that already contains images, the image is appended as a fragment at the end of the file which causes Microsoft Office to say the file is corrupted and gives the option of trying to recover.

Workbook workbook = new XSSFWorkbook(doc);
Sheet sheet;
if(workbook.getNumberOfSheets() > 0){
	sheet = workbook.getSheetAt(0);
} else {
	sheet = workbook.createSheet();
}
Drawing patriarch = sheet.createDrawingPatriarch();
ClientAnchor anchor = workbook.getCreationHelper().createClientAnchor();
anchor.setCol1(10);
anchor.setRow1(1);
anchor.setDx1(100);
anchor.setDy1(190);
((XSSFDrawing) patriarch).createLinkedPicture(anchor,"a location");
workbook.write(outDoc);
doc.close();
outDoc.close();

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] [Updated] (XMLBEANS-475) Adding image using XSSF with previous images corrupts the entire file

Posted by "Michael Benoit (Updated) (JIRA)" <xm...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XMLBEANS-475?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Benoit updated XMLBEANS-475:
------------------------------------

    Attachment: OnePicture.xlsx
    
> Adding image using XSSF with previous images corrupts the entire file
> ---------------------------------------------------------------------
>
>                 Key: XMLBEANS-475
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-475
>             Project: XMLBeans
>          Issue Type: Bug
>    Affects Versions:  Version 2.3
>         Environment: Windows 7, eclipse, java 1.6
>            Reporter: Michael Benoit
>         Attachments: OnePicture.xlsx
>
>
> When I try to add images to an xlsx file that already contains images, the image is appended as a fragment at the end of the file which causes Microsoft Office to say the file is corrupted and gives the option of trying to recover.
> Workbook workbook = new XSSFWorkbook(doc);
> Sheet sheet;
> if(workbook.getNumberOfSheets() > 0){
> 	sheet = workbook.getSheetAt(0);
> } else {
> 	sheet = workbook.createSheet();
> }
> Drawing patriarch = sheet.createDrawingPatriarch();
> ClientAnchor anchor = workbook.getCreationHelper().createClientAnchor();
> anchor.setCol1(10);
> anchor.setRow1(1);
> anchor.setDx1(100);
> anchor.setDy1(190);
> ((XSSFDrawing) patriarch).createLinkedPicture(anchor,"a location");
> workbook.write(outDoc);
> doc.close();
> outDoc.close();

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org