2

I want to save just one page of a document but when i try to save it doesn't give me any option and it saves all 15 pages in just one document. Is there any way to do select only one page?

VLAZ
  • 26,331
  • 9
  • 49
  • 67
Damian _
  • 21
  • 1

1 Answers1

3

I have a similar code. Maybe this will help you.

Procedure SaveDocument(ObjectDocument) Export 
    
    // Printing the first page
    SpreadsheetDocument = New SpreadsheetDocument;
    SpreadsheetDocument.FitToPage           = ObjectDocument.FitToPage;
    SpreadsheetDocument.PageOrientation     = ObjectDocument.PageOrientation;
    SpreadsheetDocument.PrintScale          = ObjectDocument.PrintScale;
    SpreadsheetDocument.PageSize            = ObjectDocument.PageSize;
    
    For counter = 1 To ObjectDocument.TableHeight Do
        
        SpreadsheetDocument.Clear();
        SpreadsheetDocument.Put(ObjectDocument.GetArea(1,1,counter,ObjectDocument.TableWidth));
        
        If SpreadsheetDocument.PageCount() > 1 Then 
            
            EndOfFirstPage = counter - 1;
            Break;
        EndIf;
        
    EndDo;
    
    Output(ObjectDocument.GetArea(1,1, EndOfFirstPage, ObjectDocument.TableWidth))
    
EndProcedure